DocumentAutomaticallyUpdateStyles Property |
Namespace: Aspose.Words
Document doc = new Document(); // Empty Microsoft Word documents by default come with an attached template called "Normal.dotm" // There is no default template for Aspose Words documents Assert.AreEqual(string.Empty, doc.AttachedTemplate); // For AutomaticallyUpdateStyles to have any effect, we need a document with a template // We can make a document with word and open it // Or we can attach a template from our file system, as below doc.AttachedTemplate = MyDir + "Busniess brochure.dotx"; Assert.IsTrue(doc.AttachedTemplate.EndsWith("Busniess brochure.dotx")); // Any changes to the styles in this template will be propagated to those styles in the document doc.AutomaticallyUpdateStyles = true; doc.Save(ArtifactsDir + "Document.AutomaticallyUpdateStyles.docx");