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

    RichTextBox Print

    Hi,
    I want to print an RTF doc to a file through a PostScript printer driver:
    1.- How can I print to any printer?
    2.- How can I pass the name of file if the it prints to a file ?

    Thanks,

    I. Lacosta


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: RichTextBox Print

    That will print any file

    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

    Dim lngResult As Long
    lngResult = ShellExecute(Me.hwnd,"Print",strFile,0&,0&,vbMinimized)

    where strFile is the full path to your file





    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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