Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Exception
ArgumentException
ArgumentException

SetDocumentProperty will throw this exception if an invalid type is passed for the property.

  • CreationDate, EditTime and LastPrintedDate must be of type System.DateTime.
  • RevisionNumber must be of type int.
  • ScaleOrCrop and LinksUpToDate must be of type Boolean.
Remarks

This feature is available in OOXML files (DOCX/DOCM) only.

Setting the value to null will clear any existing values.

This is the MS Word equivalent of File menu > Info > Show All Properties:

Web only
To see what this looks like, go to our online documentation:
To see what this looks like, go to our online documentation:

Image Modified Image Modified

Image Removed

!DocumentPropertiesPanel.png|thumbnail, border=1!

Web only

Example
Code Block
csharp
csharp
titleC#

//--- Set "Author" Property
WordTemplate wt = new WordTemplate();
wt.Open(@"c:\templates\Template.doc");
wt.SetDocumentProperty(DocumentProperties.BuiltInProperty.Author, "Jennifer WordSmith");
wt.Process();
wt.Save(@"c:\reports\Report.doc");
Code Block
vb.net
vb.net
titlevb.net
//--- Set "Author" Property
Dim wt As New WordTemplate()
wt.Open("c:\templates\Template.docx")
wt.SetDataSource(DocumentProperties.BuiltInProperty.Author, "Jennifer WordSmith")
wt.Process()
wt.Save("c:\reports\Report.docx")