officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentproperties-2948c311.md
Gets or sets the name of a template attached to the document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
string Template { get; set; }
Property Template As String
| Type | Description |
|---|---|
| String |
The template name.
|
The Template property is for informational purposes only and usually contains only the file name of the template without the path. It does not allow you to specify a custom template for a document.
The code sample below shows how to specify the Template property:
using DevExpress.XtraRichEdit.API.Native;
private void AddNewProperties(RichEditDocumentServer wordProcessor)
{
Document document = wordProcessor.Document;
document.BeginUpdate();
document.DocumentProperties.Manager = "John Doe";
document.DocumentProperties.Company = "TestDoc";
document.DocumentProperties.Application = "My Application";
document.DocumentProperties.Template = "MyTemplate.dotm";
document.DocumentProperties.AppVersion = "2.0";
document.EndUpdate();
}
Imports DevExpress.XtraRichEdit.API.Native
Private Sub AddNewProperties(ByVal wordProcessor As RichEditDocumentServer)
Dim document As Document = wordProcessor.Document
document.BeginUpdate()
document.DocumentProperties.Manager = "John Doe"
document.DocumentProperties.Company = "TestDoc"
document.DocumentProperties.Application = "My Application"
document.DocumentProperties.Template = "MyTemplate.dotm"
document.DocumentProperties.AppVersion = "2.0"
document.EndUpdate()
End Sub
Note
Microsoft Word resets the Template property to Normal.dotm if the property value does not match with a name from the Word template collection.
See Also