I have had this working for a couple of years ago with pdf using a class called Megashell from the other site. With thanks to them. It will work with dwf's too.
Sub openpdf()
Dim st As String
st = MegaShell("C:\Documents and Settings\kj\My Documents\Drawing1.pdf", "Print", 3)
End Sub
Option Explicit
Declare Function ShellExecute Lib _
"shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation _
As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal _
lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function FindExecutable _
Lib "shell32.dll" Alias "FindExecutableA" _
(ByVal lpFile As String, ByVal lpDirectory _
As String, ByVal lpResult As String) As Long
'@~~~~~~~~~~~~ Mega Shell ~~~~~~~~~~~~@
' Designed for AutoCAD 2000/i
'
' FILE VALUES
' Full Path & File name (including extension)
' Directory (see tasks listed for use.)
'
' TASK VALUES
' Edit - Use if strFile is a document
' Explore - use if strFile is a directory
' or if strFile is vbNullstring
' (CurDir will open)
' Find - initiates a search for strFile
' The search begins in the folder
' That I currently have set to the
' CurDir, to use this option add an
' additional argument for a directory
' to begin searching in and replace
' the "CurDir" I used with that value.
' Open - strFile can be a document, Exe, or
' folder.
' Print - strFile must be a document.
' vbNullString - The default action for the
' strFile type will be used.
' or if no default, Open will
' be used.
' Assuming that the application supports
' The specified task for the file type.
'
' WINDOW STATE
' 0 (Hide Window)
' 1 (Show Normal - No Focus)
' 2 (Show Minimized - No Focus)
' 3 (Show Maximized - No Focus)
' 4 (Show but do not set focus)
' 5 (Displays the window in its current state)
' 6 (Minimize and activate the next in Z order)
' 7 (Show Minimized - No focus)
' 8 (Show Window in Current state)
' 9 (Restore Window to original state)
' If the Window is not currently open (and
' chances are that its not) the "current
' state" means the state that is stored in the
' Registry.
'
' Return Values:
' 2 = File Not Found
' 3 = Path Not Found
' 5 = Access Denied
' 27 = Incomplete Association
' 28 = DDE Timed Out
' 29 = DDE Failed
' 30 = DDE Busy
' 31 = No File Association
' 32 = DLL Not Found
' 33+ = Success.
'/////// Interesting fact ///////////
' The success return value is set for
' Compatibility with 16 bit Windows apps.
' It is essentially "faking" a handle to
' The instance of the shelled application.
'////////////////////////////////////
' There are even more details that can be
' covered when we start talking shell
' Execution, and more arguments that can
' Be applied. If you have any questions,
' Feel free to ask!
'
' Comments:
' This is capable of even more by providing
' The optional parameters, but the code is
' At it's generic best like this.
' (Optional parameters apply to EXE files)
' If you are using AutoCAD R14 you have only
' To change the lngHwnd variable from This
' Drawing to the value returned by FindWindow
' If your not sure what I mean, feel free to
' Ask, or visit our partially complete API
' Guide:
' < http://vbdesign.hypermart.net/cadpages/findwindow.htm >
Public Function MegaShell(strFile As String, strTask As String, lngWinState As Long) As Long
Dim lngRet As Long
Dim lngHwnd As Long
On Error GoTo Err_Control
lngHwnd = 0&
lngRet = ShellExecute(lngHwnd, strTask, strFile, vbNullString, CurDir, lngWinState)
MegaShell = lngRet
Exit_Here:
Exit Function
Err_Control:
Select Case Err.Number
'Enter additional cases
Case Else
MsgBox Err.Description
End Select
End Function