Using merge tags with Microsoft Office custom document properties
FileHold has the ability to link metadata and system values using merge tags to custom document properties in a Microsoft Office document. For example, a metadata field, document control number, approval status, etc. This is beneficial when working documents in Office require up to date information from FileHold or when merge tag information is needed in a documents and it will not be converted to the PDF format.
When a document is viewed, Assembled or converted to PDF in FileHold, the merge tags are automatically evaluated and the custom properties are updated so the user is working with the latest information. When a document version is downloaded, the merge tags are automatically evaluated and updated in the custom properties for users that are assigned a level 2, or higher, FileHold viewer. The merge tags are not evaluated when a document is sent by Courier.
The Office applications whose custom properties can be updated from merge tags include Word, Excel and PowerPoint including file extensions ".doc", ".dot", ".docx", ".docm", ".dotx", ".dotm", ".rtf", ".odt", ".ott", ".xlsx", ".xlsm", ".pptx", ".pptm". Some of these extensions may be excluded for use with the viewer, Assemble or convert to PDF.
The merge tag / custom property replacement feature is disabled by default and must be enabled by a Windows administrator using the "EnableOfficeCustomPropertyUpdates" web config option.
To enable Office custom property replacement
- On the FileHold server, set the key "EnableOfficeCustomPropertyUpdates" to "true" in the web.config in C:\Program Files\FileHold Systems\Application Server\LibraryManager. Look in the <appSettings> node for <add key="EnableOfficeCustomPropertyUpdates" value="true"/>.
- Create an Office document in one of the supported applications.
- Add custom properties using the merge tag as the property name to the document.
- In the Name field, enter the merge tag. For example, if you have a metadata field named "Customer", the property name would be [[md|Customer]].
- In the Type field, select Text.
- In the Value field, enter a default value. All merge tags must have a “Text” type and a default value specified. For example, "tbd-Customer".
- Once the custom property is added, it appears in the Properties list.
- Test that the properties have been configured correctly by adding the file to FileHold, set or check the metadata or system values associated with the merge tags defined in the custom properties, open or make a local copy, inside the Office application check the custom properties tab and confirm the values match the values shown in FileHold. If a value was not updated, verify the merge tag is formatted correctly, metadata names match the values in FileHold, etc.
In Microsoft Office 2019, the custom properties are located under File > Info > Properties > Advanced Properties > Custom tab. Refer to the Microsoft Word help to learn how to add custom properties for your particular version.
How to use custom properties in Office applications
The following is a short introduction to using custom properties with three Office applications. Review Microsoft documentation for a complete explanation of how to use document properties.
Using a custom property in Word
Of all Office applications, Word provides the most effective native interface for using custom properties as a part of documents.
- In the Word document itself, the merge tag properties are added using the DocProperty fields. In Microsoft Office 2019, the custom properties are located under Insert> Quick Parts> Field. Refer to the Microsoft Word help to learn how to add fields for your particular version.
- In the Field window, select DocProperty field name.
- In the Property list, select the merge tags to be added to the document.
- The document property is placed in the document with the default value displayed.
- When the document is opened from FileHold, the default values will be updated to match the information inside FileHold.
Using a custom property in Excel
Unlike Word, Excel does not provide access to fields directly in a sheet. However, they are available in VBA macros using the CustomDocumentProperties property of a Workbook.
For example, set the first cell in the active sheet to the "Customer" metadata field with Cells(1, 1).Value = ThisWorkbook.CustomDocumentProperties("[[md|Customer]]").
Using a custom property in PowerPoint
Similar to Excel, PowerPoint does not provide direct access to fields directly in the presentation contents, but it does provide a CustomDocumentProperties property for the Presentation.
For example, add an ActiveX label to a slide and call it "Customer", now you can set the caption for the label with Customer.Caption = Application.ActivePresentation.CustomDocumentProperties("[[md|Customer]]").