![]() ![]() To remove built-in and custom document propertiesįor (DocumentProperty prop : doc. To remove attached template from Word document In case you have further inquiries or may need any help, please let us try running the following code: Document doc = new Document("C:\\temp\\InputTestDocWMetaData2_updated_OutputFile\\InputTestDocWMetaData2_updated_OutputFile.docx") To assign Normal template to document, just assign empty string to Document.AttachedTemplate property. If (field.Type = FieldType.FieldMergeField) // removes all merge fields removes all instances of a particular type of field from Word documentįoreach (Field field in ) To remove field(s) from Word document, please try the following code: // removes all types of fields from Word document If (footnote.FootnoteType = FootnoteType.Footnote) You can also use the Document Panel to add and remove authors. To remove Footnotes from Word document, please use following code snippet: foreach (Footnote footnote in doc.GetChildNodes(NodeType.Footnote, true)) To remove an author on the Info screen, right-click on the author’s name and select Remove Person from the popup menu. To remove Macros from Word document, please use following code: Document doc = new Document("C:\\temp\\input.docm") to remove all built-in or custom properties to remove individual built-in or custom propertyĭoc.CustomDocumentProperties.Remove("Authorized By") ĭoc.BuiltInDocumentProperties.Remove("some prop") To remove built-in and custom document properties, please use the following code: Document doc = new Document("C:\\temp\\input.docx") To remove all user information from comments, revisions and document properties, please use the following code: Document doc = new Document("C:\\temp\\input.docx") ![]() Regarding removing Text smaller than 5pt, Hidden text and White text, please use the following code: foreach (Run run in doc.GetChildNodes(NodeType.Run, true)) NodeCollection comments = doc.GetChildNodes(NodeType.Comment, true) Regarding removing Comments from Word document, please use the following code: static void RemoveComments(Document doc) foreach (Revision revision in doc.Revisions) Removing Track Changes from Word Document, you can either accept all changes or reject individual revisions by using the following code: Document doc = new Document("C:\\temp\\sample\\TestDocWMetaData.docm") ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |