0
votes

I'm looking to perform Microsoft Word automation -- straightforward stuff such as instructing Word to open a document and save it as an RTF file. But what happens if the user already has the document open in a running instance of Word? Can I still safely perform automation actions (that don't modify the document itself), or am I asking for trouble? Will this interfere with the user working on the open document? Are there any alternative ways to accomplish the same thing?

I'm only interested in Word 2003 and later (but also about the Word for the Mac, as this will eventually be a cross-platform application).

1
This seems like something that you could actually test by just running it and seeing what happens. No point getting theoretical if the experiment is easy to perform. Just my $0.02. Alternately, copy the current file to a temporary name, then open it and do a save as. Because it has a different file name, it shouldn't being you to the currently edited version's window and interfere with it. - Mr. Llama
True, but I'd rather hear the inside scoop from experts on Word automation, rather than relying on "I tested it, and it works for me" - Tony the Pony

1 Answers

1
votes

There are lot of problems in doing this.

  1. First of all Microsoft doesnt recommend to use Word for automation. use OpenXML instead. In my experience every day I ended up investigation Com exceptions by automating Word in Server. http://support.microsoft.com/kb/257757

  2. Even if you attempt to take the risk by automating, It is bad idea to use the machine where there is users interaction. If there is some dialog box opened like find or save as it will not allow another instance of Word to do any other functionality.

  3. If you dont find any other solution like me then create a new user profile called OfficeAutomationUser and follow the steps in http://theether.net/download/Microsoft/kb/288367.html

Thanks for reading my Words of caution about automating. Note: I am not C++ programmer I use VSTO with C#