开发者

Difference between Open and Create on DocumentFormat.OpenXml.Packaging.WordprocessingDocument

开发者 https://www.devze.com 2023-01-08 04:53 出处:网络
The docs for both methods read virtually identical to me. I have a template (.DOTX) which I want to open and make changes to, saving as .DOCX. What\'s the right approach? And, in fact, how do I save开

The docs for both methods read virtually identical to me. I have a template (.DOTX) which I want to open and make changes to, saving as .DOCX. What's the right approach? And, in fact, how do I save开发者_如何学JAVA the document? I see no Save method...


Using the Open method requires that the document already exists. If not, an exception is thrown.

Using the Create method will open the document if it exists or create it if it doesn't.

When you call the Close method, the document is saved automatically.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号