|
-
Oct 9th, 2000, 07:25 PM
#1
Thread Starter
Member
It's better than sex !
How I can print the content of RichTextBox with margins ?
-
Oct 9th, 2000, 08:44 PM
#2
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.
-
Oct 10th, 2000, 12:37 AM
#3
Fanatic Member
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
-
Oct 10th, 2000, 02:36 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|