"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
(e-mail address removed)
 

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