J
Joseph Geretz
I'm writing a document viewer in VB6. The basic strategy is to maintain
documents in their native application (e.g. Word) but to have the document
embedded into our own application. Using the Win API I can launch Word and
have it open the specified document at launch time, I then use the WinAPI to
embed the Word application into my own application area. When transitioning
to a new document I simply dump the existing instance of Word and open the
next document with a new instance of Word.
Optimization time...
Instead of constantly reopening new instances of Word, I'd like to reuse the
same instance of Word for subsequent documents. However, I'm having trouble
getting Word to close the current document. (Remember, I'm not using COM
here, I just have a handle to the Word application window.) I suppose the
brute force approach would be to use SendKeys to send the appropriate
keystrokes. But how to open a document? Alt-F O will trigger a dialog box
for the user to select a file, but that's not what I want. The user has
already selected a file via our own application UI. Now I just to direct a
running instance of Word to open that file. Any ideas?
Thanks for your help!
- Joe Geretz -
documents in their native application (e.g. Word) but to have the document
embedded into our own application. Using the Win API I can launch Word and
have it open the specified document at launch time, I then use the WinAPI to
embed the Word application into my own application area. When transitioning
to a new document I simply dump the existing instance of Word and open the
next document with a new instance of Word.
Optimization time...
Instead of constantly reopening new instances of Word, I'd like to reuse the
same instance of Word for subsequent documents. However, I'm having trouble
getting Word to close the current document. (Remember, I'm not using COM
here, I just have a handle to the Word application window.) I suppose the
brute force approach would be to use SendKeys to send the appropriate
keystrokes. But how to open a document? Alt-F O will trigger a dialog box
for the user to select a file, but that's not what I want. The user has
already selected a file via our own application UI. Now I just to direct a
running instance of Word to open that file. Any ideas?
Thanks for your help!
- Joe Geretz -