Difference between revisions of "Editing a template"
From Apache OpenOffice Wiki
m |
|||
Line 3: | Line 3: | ||
To edit a template: | To edit a template: | ||
− | # From the main menu, choose | + | # From the main menu, choose {{menu|File|Templates|Organize}}. The Template Management dialog opens. |
# In the box on the left, double-click the folder that contains the template that you want to edit. A list of all the templates contained in that folder appears underneath the folder name. | # In the box on the left, double-click the folder that contains the template that you want to edit. A list of all the templates contained in that folder appears underneath the folder name. | ||
# Click the template that you want to edit. | # Click the template that you want to edit. | ||
− | # Click the | + | # Click the {{button|Commands}} button. |
# From the drop-down menu, choose '''Edit'''. The Template Management dialog closes and the selected template opens. | # From the drop-down menu, choose '''Edit'''. The Template Management dialog closes and the selected template opens. | ||
− | # Edit the template just as you would any other document. To save your changes, choose | + | # Edit the template just as you would any other document. To save your changes, choose {{menu|File|Save}} from the main menu. |
: [[Image:TemplateMgt.png|thumb|none|500px|Template Management dialog.]] | : [[Image:TemplateMgt.png|thumb|none|500px|Template Management dialog.]] | ||
Line 16: | Line 16: | ||
: [[Image:TemplateMsg.png|thumb|none|500px|Apply current styles message.]] | : [[Image:TemplateMsg.png|thumb|none|500px|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. Whichever option you choose, the message box closes and the document opens in | + | 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. Whichever option you choose, the message box closes and the document opens in {{AOo}}. |
− | {{Warn|If you choose | + | {{Warn|If you choose {{button|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 re-enable this feature.}} |
<b>Note</b><br /> | <b>Note</b><br /> | ||
To re-enable updating from a template: | To re-enable updating from a template: | ||
<ol> | <ol> | ||
− | <li>Use | + | <li>Use {{menu|Tools|Macros|Organize Macros|OpenOffice 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> |
− | <li>Name the macro. For example, you could call it FixDocument. If the | + | <li>Name the macro. For example, you could call it FixDocument. If the {{button|Edit}} button is active, click it. If the Edit button is not active, click {{button|New}}, type a module name in the pop-up dialog, and click {{button|OK}}.</li> |
<li>In the Basic window, enter the following:</li> | <li>In the Basic window, enter the following:</li> | ||
<code> | <code> | ||
Line 34: | Line 34: | ||
End Sub | End Sub | ||
</code> | </code> | ||
− | <li>Click the | + | <li>Click the {{button|Run BASIC}} icon, then close the Basic window.</li> |
<li>Save the document.</li> | <li>Save the document.</li> | ||
</ol> | </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. |
Revision as of 14:25, 15 August 2021
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.)
To edit a template:
- From the main menu, choose {{#if: File |File}}{{#if: Templates | → Templates}}{{#if: Organize | → Organize}}{{#if: | → {{{4}}}}}{{#if: | → {{{5}}}}}{{#if: | → {{{6}}}}}{{#if: | → {{{7}}}}}{{#if: | → {{{8}}}}}{{#if: | → {{{9}}}}}{{#if: | → {{{10}}}}}. The Template Management dialog opens.
- In the box on the left, double-click the folder that contains the template that you want to edit. A list of all the templates contained in that folder appears underneath the folder name.
- Click the template that you want to edit.
- Click the Commands button.
- From the drop-down menu, choose Edit. The Template Management dialog closes and the selected template opens.
- Edit the template just as you would any other document. To save your changes, choose {{#if: File |File}}{{#if: Save | → Save}}{{#if: | → {{{3}}}}}{{#if: | → {{{4}}}}}{{#if: | → {{{5}}}}}{{#if: | → {{{6}}}}}{{#if: | → {{{7}}}}}{{#if: | → {{{8}}}}}{{#if: | → {{{9}}}}}{{#if: | → {{{10}}}}} from the main menu.
The next time that you open a document that was created from the changed template, the following message appears.
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. Whichever option you choose, the message box closes and the document opens in Apache OpenOffice.
Note
To re-enable updating from a template:
- Use {{#if: Tools |Tools}}{{#if: Macros | → Macros}}{{#if: Organize Macros | → Organize Macros}}{{#if: OpenOffice Basic | → OpenOffice Basic}}{{#if: | → {{{5}}}}}{{#if: | → {{{6}}}}}{{#if: | → {{{7}}}}}{{#if: | → {{{8}}}}}{{#if: | → {{{9}}}}}{{#if: | → {{{10}}}}}. Select the document from the list, click the +, and select Standard. If Standard has a + beside it, click that and select a module.
- Name the macro. For example, you could call it FixDocument. If the Edit button is active, click it. If the Edit button is not active, click New , type a module name in the pop-up dialog, and click OK .
- In the Basic window, enter the following:
- Click the Run BASIC icon, then close the Basic window.
- Save the document.
Sub FixDocument
TemplateName = ThisComponent.DocumentInfo.Template
if TemplateName <> "" then
ThisComponent.DocumentInfo.Template = TemplateName
end if
End Sub
Next time when you open this document, you will have the update from template feature back.
Content on this page is licensed under the Public Documentation License (PDL). |