Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing tiff files using VB code

Status
Not open for further replies.

dendic

Programmer
Jan 19, 2003
106
US
I have a question that seems very difficult to understand. Let me explain. I have tiff documents and pdf documents stored on my server. I'm looking for some code that would print the document without opening the application that created it. For example if I try to print a tiff file it opens the fax viewer first or if I try to print a pdf it opens acrobat reader and then I have to select the print icon to print it. I would like the file to go directly to the printer without viewing it. I been all over the internet but can get a definitive answer. Can anybody help?
 
I'm using the following code but nothing happens.

Private 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

Function PrintImage()
Dim a As Variant
'a = Me!StockNumber
Call apiShellExecute(hWndAccessApp, "print", _
"C:\805tir.tif", 0&, 0&, 1)
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top