Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private 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
PrintAnything(strFile as String)
strAction = "print" ' or open, or whatever
ShellExecute(0, strAction, strFile ,"" ,"" ,1)
End Function
'In a module...
Public 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
' In your form...
'This code modified by comaboy from original code of...
'KPD-Team 1998
'URL: [URL unfurl="true"]http://www.allapi.net/[/URL]
'E-Mail: KPDTeam@Allapi.net
'Send an E-Mail to the KPD-Team
'The guys at allapi are sooo cool for their docs on the API!!
Sub PrintAnything(strFile As String)
Dim x As Long
strAction = "print" ' or open, or whatever
x = ShellExecute(Me.hwnd, strAction, strFile, "", "", 1)
MsgBox CStr(x)' see if an error occured!
End Sub
Private Sub Form_Load()
PrintAnything "C:\Documents and Settings\Administrator\My Documents\cmcmapa4.pdf"
PrintAnything "c:\test.doc" ' or whatever
PrintAnything "c:\mapa4.pdf"' or whatever
End
End Sub