Click to See Complete Forum and Search --> : VB Printing


Larry Dillingham
February 17th, 2000, 12:57 PM
I have tons of literature on printing Bitmaps, Circles, Lines and Text straight to the printer object, but no references to printing documents, such as a Postscript files, directly to the printer.

I need to print straight to a Xerox printer, already setup as a printer on a Windows 95 machine with no prompting.

Any help is appreciated.

Larry Dillingham - VB Programmer
MyDocuments.com, Inc.

Clearcode
February 18th, 2000, 07:30 AM
Assuming you have an application associated with postscript files, then:

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 Sub PrintFile(sFilename as string)

Dim lRet as Long

lRet = ShellExecute(form1.hwnd,"print", sFilename, vbNullString, CurDir$, SW_HIDE)

End Sub




should do the trick

HTH,
Duncan Jones
Clearcode Developments Ltd