Try this:

    With commondialog1
        .DialogTitle = "Print"
        .CancelError = True
        .Flags = cdlPDReturnDC + cdlPDNoPageNums
        If RichTextBox1.SelLength= 0 Then
            .Flags = .Flags + cdlPDAllPages
        Else
            .Flags = .Flags + cdlPDSelection
        End If
        .ShowPrinter
        If Err <> MSComDlg.cdlCancel Then
            RichTextBox1.SelLength.hDC
        End If
    End With










--- In [email protected], "HouseDad" <[EMAIL PROTECTED]> wrote:



> 
> --- In [email protected], "Ulrike Haupt" <[EMAIL PROTECTED]> wrote:
> > Hi friends
> > 
> > I have an application where the contents of rtfbox is being 
> printed. How can
> > I stop that an empty page is printed afterwards?
> > 
> > the code of the 'print' button is:
> > CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
> >    If RichTextBox1.SelLength = 0 Then
> >       CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
> >    Else
> >       CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
> >    End If
> >    CommonDialog1.ShowPrinter
> >    Printer.Print ""
> >    RichTextBox1.SelPrint CommonDialog1.hDC
> >    Printer.EndDoc
> > 







'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to