Results 1 to 4 of 4

Thread: It's better than sex !

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Belgrade,Yugoslavia
    Posts
    34

    It's better than sex !

    How I can print the content of RichTextBox with margins ?

  2. #2
    Guest
    Assuming that the RichTextBox's margins are already set:

    Code:
    Private Sub cmdPrint_Click()
    Printer.Print RichTextBox1.Text
    Printer.EndDoc
    End Sub
    That should print everything in the RichTextBox as is.

  3. #3
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Matthew, your code doesn't print the formatting...
    Code:
    Dim OldSelStart As Long
    Dim OldSelLength As Long
    
    OldSelStart = RichTextBox1.SelStart
    OldSelLength = RichTextBox1.SelLength
    
    RichTextBox1.SelStart = 1
    RichTextBox1.SelLength = Len(RichTextBox1.Text)
    RichTextBox1.SelPrint
    
    RichTextBox1.SelStart = OldSelStart
    RichTextBox1.SelLength = OldSelLength
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  4. #4
    Guest
    And yours doesn't full formatting. Use the SelPrint method for it instead.
    Code:
    RichTextBox1.SelPrint Printer.hDC

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