Use Word to Create Files For My Application
I am in the process of writing a win forms desktop app in VB.net that employs user data in the form of rich text, stored internally as an object and then serialised to an XML file for persistent storage purposes.
To create the user data (the application's "document" it might be called), I have written a seperate app that tries to b开发者_StackOverflow社区e a word processor and then saves the text in my XML format that can then be opened and used in the main app.
Is there a way I can use Word to do this? Perhaps by writing an add-in or template? Just to clarify, the format of the rich text would just be a table, I then need to save this in my XML format, or save the text as my object then serialize it to file.
You could write a little VSTO addin that hooks into the FILE SAVE process, and, instead of saving the file via word, saves whatever portion of the file you want into your own XML format.
Google "VSTO REPURPOSING CONTROLS" for more details on repurposing the built in FILE SAVE function.
精彩评论