• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Controlling Word externally using VB

TakedownCA

Senior member
Hi, I'm writing some new functionality into a standalone VB prog for work. I'd like it to open a particular Word file, modify some text fields (either text boxes or activex controls), print, and exit without saving. I tried plucking the necessary code by recording a macro from within the Word file, but the syntax/commands don't seem to be the same when you try to control Word externally. Any help would be appreciated.
 
Thank you. Those links were helpful. But after meddling about a bit more, it seems that my problem is specifically with the GetObject command. I want to use it to open an existing document, and then populate several fields using other methods/properties. However, whenever I try to run GetObject(path), I get an error (I believe a type mismatch error). I get an error (a different one) when I try to use GetObject to start a new instance of Word, as well. The only time GetObject seems to work is when there is already an instance of Word running. Thanks for any help.
 
Back
Top