ok i see my example has a little problem! apparently this line
RichTextBox1.SelLength.hDC should really be... RichTextBox1.SelPrint .hDC which would make it almost identical to the code you posted, without the endDoc and the printer.print "" . Sorry, up past my bed time was just trying to be helpful, ended up spamming everyone... --- In [email protected], "HouseDad" <[EMAIL PROTECTED]> wrote: > > 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/
