Room101 General User

Joined: 16 Oct 2006 Posts: 14 Location: TX
|
Posted: Mon Nov 20, 2006 10:23 pm Post subject: Dialog to Apply Changes From Template Not Appearing (2.0.4) |
|
|
After I modify a template, Writer does not ask me if I want to apply those changes the next time I open a document based on that template. Not once have I seen this dialog box since I installed OOo.
I have searched the forums and none of the solutions I have found are working: I am using the latest version of OOo (2.0.4), and I have saved the templates in "My Templates" using File > Templates > Save.
Anybody have a clue as to why this might be happening to me when it seems to work fine for others???
Thanks for your help!!! |
|
madengineer General User

Joined: 17 Nov 2006 Posts: 31 Location: Scotland
|
Posted: Tue Nov 21, 2006 7:26 am Post subject: |
|
|
Yep, been there!
Found the answer to my problems (somewhere) in this forum a while back. I believe OO v2.0.3 (which I was using at the time) had a bug, such that any documents created with it would never present the template changes dialogue. This was due to a data value not being set somewhere.
Was your document initally created with v2.0.3?
There are also a few things you have to do to make this work (my understanding might be a bit off here though.) Although it sounds like you have done them. But just in case.
-Create the template using Templates > Save (well, you've got that one.)
-Create the document from the template (well, duh. I'm not being very helpful am I!)
Was there anything else? Oh, I dont know.
Anyway, getting to the important bit.
In your document (based on the template), click File -> Properties, and select the general tab. What's in the 'Template' field at the bottom? Should be the name of your template. If it's not, your document isn't linked with the template. If it is, well, thats a start, but doesn't necessarily mean changes to the template will be automatically detected.
Now I'm rambling a bit. But, we're getting there. This really bugged me too, and took a while to peice together, so might as well share it all.
A document seems to have two imporant data fields: one is the name of the template (which you see in the properties window), and the other is some sort of flag indicating that the template should be examined for changes when you next load the document.
That flat is cleared if you click "No" to update the changes in the mythical dialogue, or if you use OO v2.0.3!
Now the imporant bit. You can fix this with a Macro! Someone posted it a while back. I can't remember who, but I'm not claiming it as my own invention.
Just go to Tools > Macros > Organise Macros > OpenOffice.org Basic.
Cant remember exactly what I did here. Think I chose 'My Macros' and clicked New.
Then just paste it in to the macro editor. Appologies if you are allready familiar with this.
| Code: |
Sub RestoreTemplateLink
TemplateName = ThisComponent.DocumentInfo.Template
if TemplateName <> "" then
ThisComponent.DocumentInfo.Template = TemplateName
end if
End Sub
Sub ApplyMyWonderfulTemplate
ThisComponent.DocumentInfo.Template = "Wonderful template name"
End Sub
|
To run a macro, do Tools -> Macros -> Run... I'm sure you can work it out.
RestoreTemplateLink simply reads the current template name from the document, and reapplies it. In the process, this causes that hidden flag to be reset, such that when you save and reopen the document, you will be asked if you want to apply the template changes! Note - this only works if your document IS allready associated with the template - ie the template name appears in the File -> Properties dialogue.
You've done well putting up with my ramblings so far. One last thing. If you have a document which is NOT associated with the template and you want it to be, use the ApplyMyWonderfulTemplate macro. (You can rename these however you like!) Just put in the name of your template, run the macro, and walla.
Oh, and when you get the "Do you want to apply changes" dialogue, if you click no, it doesn't ask again next time. I've been told that clicking no is terminal - the only way to restore the link is to start the document from scratch etc etc etc. Rubbsih! Run the RestoreTemplateLink macro, save the document and open it again. The friendly dialogue will come back. Sorted!
This whole business should be a lot easier though!
Hope this helps.
Richard. |
|