CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: VB Printing

  1. #1

    VB Printing

    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.

  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: VB Printing

    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


    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured