Document templates Letter template in Writer

    From The Document Foundation Wiki
    Other languages:

    Foreword

    Schema image - Document template (OTT) becomes a Document (ODT)

    The video "Dokumentvorlagen in Writer - LibreOffice" shows how a Letter can be created as "Document template in Writer - LibreOffice" and links to this page here, which contains further information.

    Link to the Video

    Link to the Video (in German [DE]):

    Dokumentvorlagen in Writer - LibreOffice

    What are Document templates good for?

    All Documents in LibreOffice are based on Document templates.

    In the simplest case, this is in Writer a blank white sheet.

    However, it can also be a Letter template, a form to be filled out or a Report template.

    A Document template is a model or pattern that is used to create new Documents.

    For example, you may want to write letters frequently.

    It would be very labor-intensive if you had to write the sender each time, and determine the place for the address.

    Then with every letter questions arise, such as:

    • Which edge had I set where?
    • Which font and font size did I use?
    • And so on.

    What is the advantage of a Document template?

    The great advantage of the Document templates is that the recurring settings and specifications only have to be made once.

    You should take enough time to do this and do everything according to your ideas.

    Create a Document "Letter" for a Template

    So you first create a letter for a template in which everything recurring is specified.

    • Address field
    • Sender field
    • Margins
    • possibly a graphic
    • Format Styles / Paragraph Styles for text markups
    • Format Styles / Page Styles for different Page margins
    Note pin.svg

    Note:
    The sample letter already has a second page with a different Page Style.

    Save the "Letter" as Document template

    When the letter is finished, it can now be saved as a Document template.

    Choose File ▸ Templates ▸ Save as Template… from the menu.

    The "Save as Template" dialog displays the "Document template categories" (the Templates Folders).

    Note pin.svg

    Note:
    Category is here a synonym for Folder.

    Select the folder where the new Document template should be saved.

    For example, use the folder "My Templates".

    At the top of the dialog enter the name "Letter Max Mustermann" for the new Document template.

    You can now decide whether the letter should be saved as the Default template.

    If you set a check mark at "Set as default template", this Letter template will always be opened when you open Writer.

    Note pin.svg

    Note:
    If you have not set a check mark at "Set as default template", you can call the Letter template like all other Document templates. Choose File ▸ New ▸ Templates… from the menu. If necessary, select the filter at the top of the "Document Templates" dialog, then select the Document template and click Open.

    Then click on Save.

    Writer will save the new Document template (as an OTT file) and the dialog will close.

    You can now close "Letter".

    A Document template becomes a new document

    Document templates are stored in template folders.

    To use a Document template to create a Document, proceed as follows:

    Open Writer.

    Choose File ▸ New ▸ Templates… from the menu.

    In the "Manage templates" dialog that opens, "Text Documents" is already preselected as the filter, since we are in Writer.

    Some Templates are displayed here, depending on the Template.

    Select the "My Templates" folder here.

    The Document templates contained in the folder will be displayed.

    Click on the Document template "Letter Max Mustermann" and click Open.

    The "Template" dialog closes.

    The previously selected Document template now automatically became a new Document.

    You can now edit the new Document (i.e. write a letter) and then save it with a meaningful name, just as you are used to any other Document.

    Reusing the Document template

    The Document template "Letter Max Mustermann" remains unchanged and can therefore be used again and again.

    Set a default Document template

    You can make any Document the default Document template.

    If necessary, you can also switch back to the old standard template.

    If you have selected or created the Document you want to make the default Document template, choose via the menu File ▸ Templates ▸ Save as Template….

    In the "Save As Template" dialog select the Template folder and enter a meaningful name.

    Click on "Set as default template" below.

    Now click Save.

    The next time you open Writer or choose File ▸ New ▸ Text Document, a document will be created based on the Document template just set as default.

    Manage Document templates

    Note pin.svg

    Note:
    Writer can only manage document templates that were previously saved in Template folders.

    Create a Template folder

    Choose File ▸ Templates ▸ Manage Templates (Ctrl ▸ Shift ▸ N) from the menu.

    The "Templates" dialog opens.

    In the dialog you can click the Manage button and then select "New Category".

    A "New Category" dialog opens in which you can specify the Category name.

    Here you enter a folder name, e.g. "Letter templates".

    Click on OK.

    The "Category" (folder) is saved.

    Click Cancel.

    Delete a Template folder

    Choose File ▸ Templates ▸ Manage Templates ( Ctrl + ⇧ Shift + N ).

    The "Template" dialog opens.

    In the dialog you can click the Manage and then select Delete Category (Folder).

    Note pin.svg

    Note:
    You can delete only categories that were created custom.

    A dialog opens in which ask you, "Do you want to delete the selected category?".

    Click on Yes or No.

    Clicking Yes will delete the choosed folder.

    Click Close.

    Move a Document Template

    Template context menu
    Select Category (Move) dialog

    Choose File ▸ Templates ▸ Manage Templates from the menu.

    The "Templates" dialog will open.

    In the "Templates" dialog, select the Category that contains the Document Template to be moved.

    The Document Templates available there will be displayed.

    Right-click the Document Template you want to move.

    Click Move from the context menu.

    In the "Select Category" dialog that opens, you can select any Categories to move to.

    Alternatively, you can or Create a New Category by entering a name in this field.

    The moved Document Template is now in the Category you selected or created.

    Import a Document template

    Choose File ▸ Templates ▸ Manage Templates... from the menu ( Ctrl + ⇧ Shift + N ).

    The "Templates" dialog opens.

    Select a category to import to.

    Click the Manage button.

    Choose Import.

    The "Open" dialog will open.

    Select the desired Document template from your directory.

    Click on the Open button.

    Click the Close button.

    User paths

    The user path for Document templates can be found in the Tools ▸ Options ▸ LibreOffice ▸ Paths menu.

    The path is displayed in the "Options - LibreOffice - Paths" dialog in the "Type"-"Templates" column.

    By default, the user path is in the directory:
    C:\Users\USERNAME\AppData\Roaming\LibreOffice\4\user\template ( Windows ).

    You can change the user path by clicking the Edit… button.

    In the dialog "Edit paths: Templates" dialog, click on the Add… button.

    In the "Select Folder" dialog that opens, select the desired directory (user path) and click the Select Folder button.

    In the "Edit Paths: Templates" dialog, click on the "Path List" (it must be highlighted at the front selection point) and double click OK.

    You can now manage the Document templates in the new user path.

    Working with fields - Example

    It is common to use the mail merge function for serial letters.

    However, if only a few or individual documents are to be sent, some people find it difficult to do this with the form letter function.

    Alternatively, for individual documents, the function of "Fields" and "Conditional Text" can be useful.

    See also: Writer Guide - Chapter 17 - Fields

    Fields

    Fields can be defined to be used anywhere in the document.

    Choose File ▸ Properties… from the menu and select the "Custom Properties" tab.

    Click on the Add Property button.

    Enter "Name", "Type" and "Value".

    For example, if you want to set up the first name and last name for the address field of the letter, enter "First Name Last Name" as the name (or the desired name "Max Mustermann" for better orientation).

    For "Type" select "Text".

    For Value, enter the desired "First Name Last Name", e.g. "Max Mustermann".

    This allows you to specify fields for the entire address field.

    "Properties of file" dialog

    Fields that may vary, such as the salutation (Mr./Mrs.) are discussed below under "Conditional text".

    To enter the fields in the document, press Ctrl + F2, the tab "Document info" type "User defined".

    Mark the desired field and click on the Insert button.

    The desired text is now inserted in the document.

    Insert Field

    Press Ctrl + F2.

    In the dialog, select the "DocInformation" tab and for "Type" select Custom/Max Mustermann.

    Click Insert.

    Conditional text

    The basis of this description is the Conditional Text in the Online help.

    You can set up field commands in your document that display a specific text when a previously defined condition is met.

    For example, you can set up conditional text for a salutation in the letter.

    In this example, setting up conditional text consists of two steps.

    First, you create a variable and then define the condition.

    To define a condition variable

    First, define a variable for the condition statement.

    Choose Insert ▸ Field ▸ More Fields... - "Variables" tab from the menu.

    In the "Type" selection, click on the "Set variable" entry.

    In the "Name" input field, enter the name for the variable, for example "Salutation".

    In the Format list on the right, click the "Text" entry.

    Type 1 in the Value field below and then click Insert.

    "Fields|Variables|SetVariable" dialog

    To define a Condition and the Conditional Text

    The second part of the example is to define the condition that must be met, and to insert a placeholder for displaying the conditional text in your document.

    Place the cursor where you want to insert the conditional text in your text.

    Choose Insert ▸ Field ▸ More Fields…, and then click the "Functions" tab.

    Click "Conditional Text" in the "Type" list.

    Type Salutation EQ "3" in the Condition box.

    In other words, the conditional text will be displayed when the variable in the field that you defined in the first part of this example is equal to 3.

    The quotation marks enclosing the "3" indicate that the variable that you defined in the first part of this example is a text string.

    Type the text that you want to display when the condition is met in the Then box.

    There is almost no limit to the length of the text that you can enter.

    You can paste a paragraph into this box.

    Click Paste and then click Close.

    "Fields|Functions|Conditional Text" dialog

    To display the Conditional Text

    In this example, the conditional text is displayed when the value of the conditional variable is equal to 3.

    Place your cursor in front of the field that you defined in the first part of this example, and then choose Edit ▸ Fields....

    Replace the number in the Value box with 3, and then click Close.

    If the field does not update automatically, press F9.

    "Edit Fields" dialog

    Further Informations

    Letter Max Mustermann

    According Video

    Letter Max Mustermann - Border visible using tables (in German).

    Letter Max Mustermann - Border not visible using tables (in German).

    According to DIN 5008

    Recommended for use

    Sample letter according to DIN 5008; second side different (in German [DE]).

    DIN 5008 in Wikipedia

    DIN_5008Wikipedia logo v3.svg

    Definition Shape A ( Source: Von Flamon - Eigenes Werk, CC0 )

    Definition Shape B ( Source: Von Flamon - Eigenes Werk, CC0 )

    Related topics

    Professional text composition with Writer

    Styles in Writer

    Inheritance in paragraph styles in Writer

    Character Styles in Writer

    Dokumentenvorlagen_einsetzen (in German)

    Business letter according to DIN 5008

    Document template Letter in Writer 52

    Documentation / Manuals

    Here you will find the Documentation / Manuals:

    Documentation / Manuals

    Any questions?

    For questions on this topic go to:

    Ask.LibreOffice

    Get Involved

    Join us today and help us to make it even better!

    Get Involved

    LibreOffice is Free Software and is made available free of charge.

    Your donation, which is purely optional, supports our worldwide community.

    If you like the software, please consider a Donation.