Automation Action: Create Document
Create a formatted document and save it in various formats.
Create a document using the built-in Word Processor and save the document in various formats.
The Document Editor emulates Microsoft Word. You can format the document as you would with Word using fonts, tables, headers/footers etc. You can load an existing document file using the File - Open option. Once you save the Action the document data will be saved with your Automation (the original file will remain unchanged).
Inserting Variables
Variables can be dragged and dropped onto the document (or type the %variablename% directly in the document). These will be replaced when the Automation executes. Any formatting applied to the %variable% will be preserved when the value is replaced.
Save As
From the Save As Format list select the type of file to save when the Automation Executes. The document can be saved as:
- DOCX (Microsoft Word)
- ODT (Open Document)
- TXT (Text File)
- RTF (Rich Text File)
- HTML
- MHT
- EPub
When the Automation executes, the document template will be used to create a file in the above format. All %variables% in the document will be replaced.
If PDF format is selected then you can specify a Password. The recipient of the PDF file will need the password to open it.
If HTML format is selected then the following options are available:
- Use Inline Styles - select this option to use Inline CSS instead of a style section. This option should be used if you will use the HTML on outgoing emails.
- Embed Images - select this option to specify whether images should be embedded into the HTML or stored externally. Embedded images in the HTML document are stored in base64 encoding. This option should be used if you will use the HTML on outgoing emails.
Specify the Save To folder - click the ...
button to select a local file or use %Root% to save it in the default ThinkAutomation location.
Enter a File Name to save the document as (the extension will be added automatically based on the Save As Format if it is not specified).
If Ensure Unique File Name is enabled then ThinkAutomation will add a timestamp to the filename to ensure it is unique.
If Delete File After Message Is Processed is enabled then ThinkAutomation will remove the file when the Automation completes for the current message. This is useful if you wish to use the document in the Automation (for example, to send the document as an attachment with the Send Email action, or to use the html file as the body of an outgoing email), but do not need to keep a local copy afterwards.
You can assign the saved path & filename to a variable by selecting the variable from the Assign Path To list. You can then use this variable in the Attachments entry on Send Email actions or in any other way.
Enter the Document Name. This shows in the actions list and Automation log. If a File Name is not specified then the document name will be used. For PDF exports the PDF document properties 'title' will be set to the document name.
Default Document Template
When creating a new document, ThinkAutomation will look for the Microsoft Word document DefaultDocument.docx in the ThinkAutomation program files folder. If this file exists it will be loaded and all the styles available in the document can then be used in the new document.