"This method or property is not available" error

K

kaczmar2

Hey there,

I wrote a macro to prompt for the location of a few pictures using
wdDialogFileOpen and insert them into a Word document. It works
great, but now the user is opening this document in an application
that imbeds Word as an OLE object. Now I get run-time error '4605':
This method or property is not available because this document is in
another application."

The code snippet is below; it gives me the error on the first (With
Dialogs) line:

With Dialogs(wdDialogFileOpen)
.Name = "*.jpg; *.gif; *.bmp"
If .Display Then
strFileName = CStr(Trim(WordBasic.FilenameInfo(.Name,
1) & ""))
Else
strFileName = ""
End If
End With

Any suggesstions on how to return control or focus to the document so
I can instantiate the "open dialog" window?

Thanks, C
[email protected]
 
Top