Ask Your Question
0

How to detach a template?

asked 2015-03-09 00:16:31 +0200

LibreGuy gravatar image

Hi,

Let's say I want to send an invoice to a customer, then I could create this invoice by using a template. Great, saves me some time :) If I would open this invoice one year later and in the meanwhile the template has changed, a pop-up box will appear asking me to update the invoice. Well ... as some of you might know, an original invoice should not be updated, so that is why I'm wondering if it is possible to detach a template from a document. So ... I create a document based on a template, and then when it is completely finished I would like to detach the template so the document will never be updated (by mistake) anymore. Is that somehow possible?

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
0

answered 2015-03-09 01:24:38 +0200

Lupp gravatar image

updated 2015-03-09 01:46:53 +0200

I presently only can do it by a custom sub ("macro"). As there are disadvantages using macros, I hope someone else will know better advice. I also did not test if the document is actually and finally detached. I only tested that inserting the TemplateURL, TemplateName, and TemplaleStyle as a field after running my macro produced the emptxy text as intended. This is persistent over a store/reload cycle, however.

The sub I sketched is extremely simple:

Sub DetachTemplate()
oProp = ThisComponent.DocumentProperties
oProp.TemplateName=""
oProp.TemplateURL=""
End Sub
edit flag offensive delete link more
0

answered 2015-03-09 19:00:42 +0200

pierre-yves samyn gravatar image

Hi

Well ... as you said an original invoice should not be updated

So my approach would be: create and send the customer a pdf. If necessary create an hybrid pdf.

At the opening in LibreOffice, Hybrid pdf file opens in calc and possible modification of the template will not cause the suggestion to update.

edit flag offensive delete link more
0

answered 2015-03-09 13:05:29 +0200

AllanR gravatar image

updated 2015-03-10 13:15:20 +0200

Page 312 of Writer 4.2 Guide says: "Updating a document from a changed template....... If you choose Keep Old Styles in the message box shown in Figure 307 after changing the template, and then at some stage save the document, then that message will not appear again the next time you open the document. You will not get another chance to update the styles from the template, although you can use the macro given in the Note below to re-enable this feature."

So I think your invoice will be permanently disconnected from the template if you elect to not update.

EDIT: Here's another (simple) thought .... Open for editing your original invoice Template and save-as type .odt to a folder outwith LO’s reach, e.g. where you keep your data files. This new “working master” document will have no template link and can be used as the original to create specific invoices. If you change the Template in the future, re-create a new “working” invoice. Existing invoices will be unaffected.

edit flag offensive delete link more

Comments

Thanks for replying. You are correct, but in this case I would like to totally detach the template in advance. If I by mistake update an old file with a new template I'm kinda screwed, so I don't want that to happen at all.

LibreGuy gravatar imageLibreGuy ( 2015-03-09 13:24:34 +0200 )edit

Here's another (simple) thought .... Open for editing your original invoice Template and save-as type .odt to a folder outwith LO’s reach, e.g. where you keep your data files. This new “working master” document will have no template link and can be used as the original to create specific invoices. If you change the Template in the future, re-create a new “working” invoice. Existing invoices will be unaffected.

AllanR gravatar imageAllanR ( 2015-03-10 13:18:25 +0200 )edit
0

answered 2015-03-09 09:27:17 +0200

LibreGuy gravatar image

Thanks Lupp, that seems like a good solution. I will give it a try.

edit flag offensive delete link more

Comments

I did not test but...

Only deleting the TemplateURL and leaving the TemplateName untouched may olso break the trigger of the update suggestion, but preserve the memory of the original template.

NB: My experiments seemed to tell me that reistablishing the name and URL of a template by assigning values to the the related properties will not work.

Lupp gravatar imageLupp ( 2015-03-09 10:46:59 +0200 )edit

Allright.I don't think I'll ever need to reestablish so I don't think there will be any problem then.

LibreGuy gravatar imageLibreGuy ( 2015-03-09 12:33:17 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-03-09 00:16:31 +0200

Seen: 173 times

Last updated: Mar 10 '15