I have a test VB6 exe project with a WebBrowser control, called web1 (added via Project, Components, Microsoft Internal Controls). My project also references the Microsoft Word 10.0 Object Library.

As well as the WebBrowser control, my form has a Save button (cmdSave). Here is the complete code:

Code:
Private g_objDocument As Word.Document

Private Sub cmdSave_Click()
    g_objDocument.Save
End Sub

Private Sub Form_Load()
    Dim strFileName As String
    strFileName = App.Path & "\WordWrapper.doc"
    web1.Navigate strFileName
End Sub

Private Sub web1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    Set g_objDocument = pDisp.Document
End Sub
The idea is when I run the exe, it loads a Word document into the WebBrowser control. This document is also assigned to
a global Word.Document object, g_objDocument, when web1 navigates to it. The problem occurs when I try to save the document (in cmdSave_Click). I get the error:

"The Save method or property is not available because this document is in another application."

This error occurs with Word 2002 SP 1 (on Windows XP), but not with Word 2000 SP3.

Please help.