SelPrint doesn't work!
Posted on 1998-07-31
I am trying to print the contents of a RichTextBox using the SelPrint method. I have tried the example in the VB 4 SelPrint documentation which is as follows...
This example prints the formatted text in a RichTextBox control. To try this example, put a RichTextBox control, a CommonDialog control, and a CommandButton control on a form. Paste this code into the Click event of the CommandButton control. Then run the example.
Private Sub Command1_Click()
CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
If RichTextBox1.SelLength = 0 Then
CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
But when I try it out, nothing prints! I keyed in some text into the RichTextBox and clicked on the command button, but although there is a little disk activity (which shows something is happening), nothing prints. How can I make this example work, so that it prints? I have my printer set up properly as the default printer, so why isn't it working?