To: Michael,
Perhaps things are done differently in Excel, but from Word, you might try
something like:
Sub TestOpenDoc()
Dim sFileName As String
Dim newDoc As Document
sFileName = "C:\temp.txt"
If (Dir(sFileName) = "") Then
MsgBox "File does not exit."
Else
Set newDoc = Documents.Open(FileName:=sFileName, Visible:=False)
MsgBox "Click ok"
newDoc.Close
End If
End Sub
Steven Craig Miller
> Why does the following code executed from VBA in some host (e.g., Excel)
> display the print dialog in Word on the open call? I would like to be able
[quoted text clipped - 7 lines]
>
> End Sub
Michael - 29 May 2008 21:31 GMT
I can't open it from Word (or Excel for that matter). I need to open it in a
C++ application using COM out-of-process. However, I'm seeing the same
behavior in Excel (or any other VBA out-of-process client, e.g, Visio) as I
am in my C++ application. The code is going to be in C++ not VBA, and it
will run in a different process. I just used VBA as a sample since it is
simpler and exhibits the same behavior.
> To: Michael,
>
[quoted text clipped - 28 lines]
> >
> > End Sub