


The basic document structure of a WordProcessingML document consists of the document and body elements, followed by one or more block level elements such as p, which represents a paragraph.
.svg/1200px-Microsoft_Office_Word_(2019–present).svg.png)
Because the WordprocessingDocument class in the Open XML SDK automatically saves and closes the object as part of its System.IDisposable implementation, and because Dispose is automatically called when you exit the block, you do not have to explicitly call Save and Close as long as you use using. The block that follows the using statement establishes a scope for the object that is created or named in the using statement, in this case wdDoc. It ensures that the Dispose method (internal method used by the Open XML SDK to clean up resources) is automatically called when the closing brace is reached. The using statement provides a recommended alternative to the typical. Using wdDoc As WordprocessingDocument = WordprocessingDocument.Open(fileName, True) using (WordprocessingDocument wdDoc = WordprocessingDocument.Open(fileName, true)) To do so, you open the word processing file with the specified fileName by using the Open(String, Boolean) method, with the Boolean parameter set to true in order to enable editing the document. To open an existing document, you can instantiate the WordprocessingDocument class as shown in the following using statement. The following assembly directives are required to compile the code in this topic.
HOW TO DELETE A DOCUMENT IN WORD PROCESSOR HOW TO
This topic shows how to use the Open XML SDK 2.5 for Office to accept all revisions in a word processing document programmatically.
