Difference between revisions of "Documentation/OOo3 User Guides/Writer Guide/Editing a template"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Updating a document from a changed template)
 
(8 intermediate revisions by 3 users not shown)
Line 24: Line 24:
 
Click '''Yes''' to apply the template’s changed styles to the document. Click '''No''' if you do not want to apply the template’s changed styles to the document (but see Caution notice below).
 
Click '''Yes''' to apply the template’s changed styles to the document. Click '''No''' if you do not want to apply the template’s changed styles to the document (but see Caution notice below).
  
{{Documentation/Caution| If you choose '''No''' in the message box shown above, that message will not appear again the next time you open the document after changing the template it is based on. 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 reenable this feature.
+
{{Warn| If you choose '''No''' in the message box shown above, that message will not appear again the next time you open the document after changing the template it is based on. 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 reenable this feature.
  
You can also use the Template Changer extension (see page 12) to reactivate the template.}}
+
You can also use the [[Documentation/OOo3_User_Guides/Writer_Guide/Associate_template#Method 2|Template Changer extension]] to reactivate the template.}}
 
+
{{Note| To re-enable updating from a template:
{{Documentation/Note| To re-enable updating from a template:
+
<ol>
# Use '''Tools > Macros > Organize Macros > OpenOffice.org Basic'''. Select the document from the list, click the '''+''', and select '''Standard'''. If Standard has a '''+''' beside it, click that and select a module.
+
<li>Use '''Tools > Macros > Organize Macros > OpenOffice.org Basic'''. Select the document from the list, click the expansion symbol (+ or triangle), and select Standard. If Standard has an expansion symbol beside it, click that and select a module.</li>
# Name the macro. For example, you could call it ''FixDocument''. If the '''Edit''' button is active, click it. If the '''Edit'''
+
<li>If the '''Edit''' button is active, click it. If the '''Edit''' button is not active, click '''New'''.</li>
button is '''not''' active, click '''New''', type a module name in the pop-up dialog, and click '''OK'''.
+
<li>In the Basic window, enter the following:</li>
# In the Basic window, enter the following: <tt>Sub FixDocV3' set UpdateFromTemplate oDocSettings = ThisComponent.createInstance( _"com.sun.star.document.Settings" )oDocSettings.UpdateFromTemplate = True End Sub 'FixDocV3</tt>
+
<source lang="oobas">
# Click the Run BASIC icon, then close the Basic window.
+
Sub FixDocV3  
# Save the document.
+
' set UpdateFromTemplate  
 +
  oDocSettings = ThisComponent.createInstance( "com.sun.star.document.Settings" )  
 +
  oDocSettings.UpdateFromTemplate = True  
 +
End Sub 'FixDocV3  
 +
</source>  
 +
<li>Click the '''Run BASIC''' icon, then close the Basic window.</li>
 +
<li>Save the document.</li>
 +
</ol>
 
Next time when you open this document you will have the update from template feature back.}}
 
Next time when you open this document you will have the update from template feature back.}}
  

Latest revision as of 20:54, 13 July 2018


You can edit a template’s styles and content, and then, if you wish, you can reapply the template’s styles to documents that were created from that template. (Note that you can only reapply styles. You cannot reapply content, except for content in headers and footers.)

To edit a template:

  1. From the main menu, choose File > Templates > Organize. The Template Management dialog box opens.
  2. In the box on the left, double-click the folder containing the template that you want to edit. A list of all the templates contained in that folder appears underneath the folder name.
  3. Select the template that you want to edit.
  4. Click the Commands button and choose Edit from the drop-down menu.
  5. Edit the template just as you would any other document. To save your changes, choose File > Save from the main menu.
Template management dialog box.

Updating a document from a changed template

The next time that you open a document that was created from the changed template, the following message appears.

Apply current styles message.

Click Yes to apply the template’s changed styles to the document. Click No if you do not want to apply the template’s changed styles to the document (but see Caution notice below).

Documentation caution.png If you choose No in the message box shown above, that message will not appear again the next time you open the document after changing the template it is based on. 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 reenable this feature.

You can also use the Template Changer extension to reactivate the template.

Documentation note.png To re-enable updating from a template:
  1. Use Tools > Macros > Organize Macros > OpenOffice.org Basic. Select the document from the list, click the expansion symbol (+ or triangle), and select Standard. If Standard has an expansion symbol beside it, click that and select a module.
  2. If the Edit button is active, click it. If the Edit button is not active, click New.
  3. In the Basic window, enter the following:
  4.  Sub FixDocV3 
     ' set UpdateFromTemplate 
      oDocSettings = ThisComponent.createInstance( "com.sun.star.document.Settings" ) 
      oDocSettings.UpdateFromTemplate = True 
     End Sub 'FixDocV3
  5. Click the Run BASIC icon, then close the Basic window.
  6. Save the document.

Next time when you open this document you will have the update from template feature back.


Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools