Free Support Forum -

Attaching template appears to to work

I need to attach a template to a document. I modified the Aspose.Word.Demos.VisualBasic demo (to test this) and added the following line at the end of StampAndWatermarkDemo->Execute

doc.BuiltInDocumentProperties.Template = ""

However, although the property appears to change value, when I save the document to disk the original template is still listed (Sales manager I’ve tried putting in the full path to template, with no change. Any suggestions?

I think I know what the problem is. The Template property you are talking about seems rather informational in MS Word. There is another place where MS Word stores the name of the attached template and it is not yet exposed as a public property, I will log this and try implement in the next 1-2 weeks.


We have released Aspose.Word 3.1.2.

  • Setting BuiltInDocumentProperties.Template now sets the template the document is attached to.

    Perfect! Thanks for the amazingly quick response.