开发者

Temporarily save Word document changes

开发者 https://www.devze.com 2022-12-17 02:09 出处:网络
I\'m using Interop to create a \"custom word editor\", basically I\'ve incorporated MS Word on my application and I allow users to edit a document and insert custom fields from a predefined lis开发者_

I'm using Interop to create a "custom word editor", basically I've incorporated MS Word on my application and I allow users to edit a document and insert custom fields from a predefined lis开发者_开发技巧t.

I provide a "Preview" option to see how the document will appear when the data is added.

The users can start editing a template on my application, and at any time they can hit preview and the preview should appear with the latest changes.

I want the user to be able to preview the document without saving the changes, the problem is that when I invoke SaveAs() on the document (to create a temp file that I can use as the input for the preview generator), the editor opens the temp document.

Is there a way to save a copy of the document being edited but keep the original (open) document with its changes unsaved?

Thanks a lot


I know this can be done in pre-2007 Word, as described in this post.

Unfortunately, that solution does not work in Word 2007.

How about using a temp file from the get-go, and only saving to the "true" file when the user indicates that he or she is done?

0

精彩评论

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