ah, i see this is supposed to launch a hidden instance of acrobat which will print the given file. i knocked up a version of you're code as a function, which does launch acrobat in the way you want...
Function openPDF(strDocName As String) As Double
If strDocName Like "*.pdf" Then
'--fire the shell command to launch acrobat
'--note the use of chr(34) which is used to enclose the file paths in " " in the string we send to the
shell commands.
'--this prevents mis-interpretation of 'long filenames' by shell
'--as far as including the document filename as a variable is concerned, its just a case of string
concatenation
'--i also think the comma after the switches may have been a typo!
'-- i am using acrobat 3, which does not like the /n switch at all. i don't know if this really is a
valid switch in acrobat 4, may be worth confirming that.
openPDF = Shell(Chr(34) & "C:\Program Files\Acrobat 4.0\Reader\AcroRd32.exe" & Chr(34) & " /p/h " &
Chr(34) & strDocName & Chr(34), 0)
Else
'--not *.pdf file, do something else...
End If
End Function
_____________________________
it's then just a case of calling this function and passing the file you want as the argument (the function will return the 'handle' to the acrobat instance, which may or may not have a use for):-
RetVal = openPDF( "C:\YourDirectory\YourFile.pdf")
hope that helps.
axa
[This message has been edited by axa (edited 03-20-2001).]
[This message has been edited by axa (edited 03-20-2001).]