Print a shared PDF file

dim1962

Registered User.
Local time
Today, 06:52
Joined
Mar 24, 2009
Messages
15
Hi All,

I'm a beginner in Access Programming, but I like to know if is possible to print from a form a specific shared PDF file located on the network.
In other words I have a form where I want to add a button which will send to the printer a specific PDF file located to a specific path on the network.
If is possible, what is the easiest way to do it?

Thanks a lot!
 
Add this code to a module in your applications:


Code:
Public Declare Function apiShellExecute 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

Then use this code to open Acrobat Reader and print the document specified by PathName:


Code:
Dim hwndret As Long
    hwndret = apiShellExecute(0, "print", PathName, vbNullString, vbNullString, 3)


Note that Reader will remain open and mnimized after printing is completed
 

Users who are viewing this thread

Back
Top Bottom