I am using Rich Text Box control to print a formatted letter (mail merged).
The user should be able to specify the printable area width, but the printer always picks page width from default setting.
I tried the following code:-
Private Sub cmdPrint_Click()
' The CommonDialog control is named "dlgPrint".
' The RichTextBox control is named "rtfData".
dlgPrint.Flags = cdlPDReturnDC + cdlPDNoPageNums
If rtfData.SelLength = 0 Then
dlgPrint.Flags = dlgPrint.Flags + cdlPDAllPages
Else
dlgPrint.Flags = dlgPrint.Flags + cdlPDSelection
End If
dlgPrint.ShowPrinter
Printer.PaperSize = 256 ' Custom/User defined
Printer.Width = 150
Printer.Height = 150
rtfData.SelPrint Printer.hDC ' PRINTS the Control content
End Sub
Following commands do not show any effect !!! Please HELP.
Printer.PaperSize = 256 ' Custom/User defined
Printer.Width = 150
Printer.Height = 150
Setting PaperSize in Printer dialog helps, but is too cumbersome.
I DO NOT want to use WORD Mail merging as i need to distribute the application.
I have Visual Basic 6.0 Enterprise Edition running on Windows 98.
Thanks
Aman Bains
Aman
-------
Lets fly away to the Land where there is Love & Peace