Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I would like to use Word as Reporting tool for a database application. I can export the data to XML and embed it in a .docx file. But now, how do I create an "Edit session" with Word, in which the user can make modifications, print-outs etc. As default the file shall be temporary and discarded when Word is closed. Also, the user shall get a notification/security reminder when he saves the file.

Is that possible?

Thanks
/J
Posted

1 solution

One way is to use Interop with Word. Have a look at Microsoft.Office.Interop.Word Namespace[^]. You can create documents, wire events etc.
 
Share this answer
 
Comments
bjarket 6-Dec-11 5:29am    
Thanks, no, I haven't. I guess I could get a notification event before the document is saved. Not sure if I can make it modal though, such that the message box appears as part of Word...

Ideas about how to open the document as a temporary file would also be much appreciated.
Thanks.
Wendelius 6-Dec-11 5:32am    
If you create an instance of the Word, the document is actually memory resident (not saved yet). You can use interop to save it for example into temp folder if you like, but it's not necessary.
bjarket 6-Dec-11 5:58am    
That sounds great. However, could you please explain what is meant by creating an instance of the Word - you mean opening the .docx file with Word, or?
Wendelius 6-Dec-11 6:27am    
There are lots of articles showing how you can control Word application via interop. Here's one example: Summarize C# Control Word Skills[^]
bjarket 6-Dec-11 6:30am    
Yes, thanks for the interop advice. I can see that I need to get started reading ;-) Thanks /J

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900