|
-
March 9th, 2004, 05:19 AM
#1
Error 4605 calling Word.Document.Save with Word 2002 SP1
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.
-
December 5th, 2005, 06:26 AM
#2
Re: Error 4605 calling Word.Document.Save with Word 2002 SP1
Did U found any solution to this?
Best regards,
Krzemo.
-
December 5th, 2005, 06:32 AM
#3
Re: Error 4605 calling Word.Document.Save with Word 2002 SP1
See this:
Code:
' mobjCurrentDocument.Save with Word 2002 gives the error 4605:
' "The Save method or property is not available because this document is in
' another application".
' This was raised with Microsoft who acknowledged it is a
' bug in Word 2002 and suggested the following workaround.
web1.ExecWB OLECMDID_SAVE, OLECMDEXECOPT_DONTPROMPTUSER
-
December 5th, 2005, 07:00 AM
#4
Re: Error 4605 calling Word.Document.Save with Word 2002 SP1
Works very good.
Thanks a lot!
Best regards,
Krzemo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|