IncludeFullPath
Contents
[
Hide
]FieldTemplate.IncludeFullPath property
Gets or sets whether to include the full file path name.
public bool IncludeFullPath { get; set; }
Examples
Shows how to use a TEMPLATE field to display the local file system location of a document’s template.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// We can set a template name using by the fields. This property is used when the "doc.AttachedTemplate" is empty.
// If this property is empty the default template file name "Normal.dotm" is used.
doc.FieldOptions.TemplateName = string.Empty;
FieldTemplate field = (FieldTemplate)builder.InsertField(FieldType.FieldTemplate, false);
Assert.AreEqual(" TEMPLATE ", field.GetFieldCode());
builder.Writeln();
field = (FieldTemplate)builder.InsertField(FieldType.FieldTemplate, false);
field.IncludeFullPath = true;
Assert.AreEqual(" TEMPLATE \\p", field.GetFieldCode());
doc.UpdateFields();
doc.Save(ArtifactsDir + "Field.TEMPLATE.docx");
See Also
- class FieldTemplate
- namespace Aspose.Words.Fields
- assembly Aspose.Words