RichTextBox.SelPrint Bug??? Please Help 
Author Message
 RichTextBox.SelPrint Bug??? Please Help

I am fairly new to VB (an advanced beginner--which means I still know
next to nothing).  

After being unable to get the RichTextBox.SelPrint method to work I
resorted
to doing the example from page 352 of the Custom Control Reference Manual
(Professional Features) shown below.  This didn't work.

Private Sub Command1_Click()
    CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
    If RichTextBox1.SelLength = 0 Then
        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
    Else
        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
    End If
    CommonDialog1.ShowPrinter

    RichTextBox1.SelPrint CommonDialog1.hDC
End Sub

So I have messed around with this trying a number of different things
including the following which also seems like it ought  to work.  Nope.
Is this a known issue?  Is there a workaround?  I'm I just being an
idiot and missing something obvious?

Private Sub Command1_Click()
    CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
    If RichTextBox1.SelLength = 0 Then
        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
    Else
        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
    End If
    CommonDialog1.ShowPrinter

    RichTextBox1.SelPrint Printer.hDC
End Sub

Please help.  Send me email in addition to replying to the newsgroup
if you would.  Thanks.

Don Cassidy



Sun, 19 Sep 1999 03:00:00 GMT  
 RichTextBox.SelPrint Bug??? Please Help

There is an article on the MS KB site about WYSWIG printing. (don't recall the
number) and it works pretty well.

Search the KB for WYSWIG and RTF and be prepared to do some API calling...

  >I am fairly new to VB (an advanced beginner--which means I still know
  >next to nothing).  
  >
  >After being unable to get the RichTextBox.SelPrint method to work I
  >resorted
  >to doing the example from page 352 of the Custom Control Reference Manual
  >(Professional Features) shown below.  This didn't work.
  >
  >Private Sub Command1_Click()
  >    CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
  >    If RichTextBox1.SelLength = 0 Then
  >        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
  >    Else
  >        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
  >    End If
  >    CommonDialog1.ShowPrinter
  >  
  >    RichTextBox1.SelPrint CommonDialog1.hDC
  >End Sub
  >
  >So I have messed around with this trying a number of different things
  >including the following which also seems like it ought  to work.  Nope.
  >Is this a known issue?  Is there a workaround?  I'm I just being an
  >idiot and missing something obvious?
  >
  >Private Sub Command1_Click()
  >    CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
  >    If RichTextBox1.SelLength = 0 Then
  >        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
  >    Else
  >        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
  >    End If
  >    CommonDialog1.ShowPrinter
  >  
  >    RichTextBox1.SelPrint Printer.hDC
  >End Sub
  >    
  >Please help.  Send me email in addition to replying to the newsgroup
  >if you would.  Thanks.
  >
  >Don Cassidy
  >
  >



Tue, 21 Sep 1999 03:00:00 GMT  
 RichTextBox.SelPrint Bug??? Please Help



Don,
        The VB manual is WRONG. The MS Knowledge base has a fix for
this. Goto this page:

http://search.microsoft.com/searchbin/kb/mts_search.idq?Scope=%2Fkb%2...?c

(Don't you just love Microsoft's search syntax?)

        There are several articles here, and at least TWO are relevant
to your question. Hope this helps!

                                                (: GT :)

--

Fregata Software                            | may be a fool, but
--------------------------------------------| he who opens his
http://www.carroll.com/p/etabaka/index.html | mouth proves it.

Quote:

>After being unable to get the RichTextBox.SelPrint method to work I
>resorted
>to doing the example from page 352 of the Custom Control Reference Manual
>(Professional Features) shown below.  This didn't work.

>Private Sub Command1_Click()
>    CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
>    If RichTextBox1.SelLength = 0 Then
>        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
>    Else
>        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
>    End If
>    CommonDialog1.ShowPrinter

>    RichTextBox1.SelPrint CommonDialog1.hDC
>End Sub

>So I have messed around with this trying a number of different things
>including the following which also seems like it ought  to work.  Nope.
>Is this a known issue?  Is there a workaround?  I'm I just being an
>idiot and missing something obvious?

>Private Sub Command1_Click()
>    CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
>    If RichTextBox1.SelLength = 0 Then
>        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
>    Else
>        CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
>    End If
>    CommonDialog1.ShowPrinter

>    RichTextBox1.SelPrint Printer.hDC
>End Sub

>Please help.  Send me email in addition to replying to the newsgroup
>if you would.  Thanks.

>Don Cassidy


Fregata Software                            | may be a fool, but
--------------------------------------------| he who opens his
http://www.carroll.com/p/etabaka/index.html | mouth proves it.


Wed, 22 Sep 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help Me please Bug on RichTextBox ??

2. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

3. SelPrint: Help, please!

4. SelPrint method with RichTextBox printing microscopic

5. RichTextbox SelPrint Problem

6. RichTextBox.SelPrint only prints part of the RTB

7. RichTextBox Control - SelPrint Problem

8. RichTextBox.Selprint

9. Printing with RichTextBox.SelPrint method

10. Printing with RichTextBox.SelPrint method

11. VB/WIN -RichTextBox Control-SelPrint Method

12. RichTextBox SelPrint Fails on Multiple Uses

 

 
Powered by phpBB® Forum Software