Unable to close Microsoft Word within AxWebBrowser Control

D

Dean Richardson

Hello,

I am currently opening Word in an AxWebBrowser Control on a form. When
the user saves the saves the document using a save + close button on
the form, it saves the document, navigates the AxWebBrowser Control to
about:blank and exits word and then closes the form.

The exiting of word and the closing of the form is run in the
AxWebBrowser.NavigateComplete event handler.

The issue I have, is if the user clicks the close button on the form,
it still leaves word running.

If I try to exit word in the form.closing or form.closed event
handler, it has an error as the word document is still displaying in
the AxWebBrowser Control. Because the form is closing, it cannot run
the AxWebBrowser.NavigateComplete event handler.

This then leaves multiple instances of Word open in the Process
tables.

Does anyone know if there is a way of closing word without any errors
when the user closes the form?

Many Thanks,
Dean
 
D

Dean Richardson

Did you try dsoframer?

--
Sheng Jiang












- Show quoted text -

Hi,

In the end, we had the Word.Application open when the application
opened and closed it when the application closed. We then opened the
word documents as Word.Document and this opened within the existing
word app container.

I will use DSOFramer in future though as it looks better than the
AxWebBrowser control.

Thanks,
Dean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top