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

Re: Unable to close Microsoft Word within AxWebBrowser Control by Sheng

Sheng
Tue Jul 24 13:45:43 CDT 2007

Did you try dsoframer?

--
Sheng Jiang
Microsoft MVP in VC++
"Dean Richardson" <advertising@deanrichardson.com> wrote in message
news:1185294163.588052.14950@k79g2000hse.googlegroups.com...
> 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
>



Re: Unable to close Microsoft Word within AxWebBrowser Control by Dean

Dean
Thu Jul 26 03:04:52 CDT 2007

On 24 Jul, 19:45, "Sheng Jiang[MVP]" <sheng_ji...@hotmail.com.discuss>
wrote:
> Did you try dsoframer?
>
> --
> Sheng Jiang
> Microsoft MVP in VC++"Dean Richardson" <advertis...@deanrichardson.com> wrote in message
>
> news:1185294163.588052.14950@k79g2000hse.googlegroups.com...
>
>
>
> > 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- Hide quoted text -
>
> - 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