b3cf
asked on
How to print the contents of a Rich Text box
Hi,
Could someone advice me on how I could print the contents of a Rich Text box.
Any help is greatly appreciated.
Thanx
Could someone advice me on how I could print the contents of a Rich Text box.
Any help is greatly appreciated.
Thanx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
slight correction to anthony's first post: shouldn't it be RichTextBox1.SelPrint Printer.hDC ?
.SelPrint will tell the rich text box to print the Selected portion of the text.
You might want to say before that:
.SelStart = 0
.SelLength = len(.Text)
You might want to say before that:
.SelStart = 0
.SelLength = len(.Text)
bobbit31:
>slight correction to anthony's first post:
>shouldn't it be RichTextBox1.SelPrint Printer.hDC ?
The Common Dialog control would not automatically change the printer referenced by the Printer object.
Here is an excerpt from the VB Documentation:
With a CommonDialog control, this property returns a
device context for the printer selected in the Print
dialog box when the cdlReturnDCflag is set or an
information context when the cdlReturnIC flag is set.
>slight correction to anthony's first post:
>shouldn't it be RichTextBox1.SelPrint Printer.hDC ?
The Common Dialog control would not automatically change the printer referenced by the Printer object.
Here is an excerpt from the VB Documentation:
With a CommonDialog control, this property returns a
device context for the printer selected in the Print
dialog box when the cdlReturnDCflag is set or an
information context when the cdlReturnIC flag is set.
> The Common Dialog control would not automatically
i said his first post ;)
i said his first post ;)
So there is no confusion, please ignore my first post and use something similar to what I posted in my second post together with ventond's code.
Anthony
Anthony
>i said his first post ;)
Oh! Oops! ;)
Oh! Oops! ;)
RichTextBox1.SelPrint
Anthony