Ed,
Open VBE, call 'Help' and enter the terms shell and function to get the full
syntax.
Here is a small example that prints C:\Test\Map.pdf on the default printer.
However, despite using Shell to insist that Acrobat reader be minimized with
focus, it only starts that way and then shows in a normal window while the
pdf prints. Not ideal but it can be made to do close to what you want.
____________________________
Sub PrintPDF()
Dim strPDF As String
Dim strReader As String
Dim RetVal
strPDF = "C:\Test\Map.pdf"
strReader = "C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe"
RetVal = Shell(strReader _
& " /t " & strPDF, vbMinimizedFocus)
End Sub
__________________________________
Steve Yandl
Hi, Steve. As I was researching this, i found references to using
Shell with
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(strF)
Set objFolderItem = objFolder.ParseName(strI)
objFolderItem.InvokeVerbEx ("Print")
but it didn't seem to work. I keep erroring on
Set objFolderItem = objFolder.ParseName(strI)
The code finds the item and strI is correct, but objFolderItem is
always Nothing. My error is:
Error Number: 13
Error Is: Type mismatch
I'm not familiar with Shell, so I'm not sure how to invoke the
application and then quit it.
Ed