>I am trying to print from the MS rich text control. They give an example of how to print from the control in the help file...but the example is VB based and does not seem to work.
>
>ThisForm.oleCommonDialog.ShowPrinter && Displays dialog just fine...
>
>* there is a command here that I do not know how to replicate in VFP
>* Printer.Print ""
>* but I'm guessing is my missing link...Then,
>
>ThisForm.oleRTC.SelPrint(ThisForm.oleCommonDialog.hDC)
>
>I get an error on the above line that I have an invalid HDC...
>
>Any ideas how to correct this?
>
>Thanks in advance.
Bob,
Download vbPrinter.ocx, and drop it on your form:
http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,54,Forum=5,28,1103Assuming that you name the vbPrinter control 'oPrinter', and your richtext control is oRtf, you can print the selection with:
thisForm.ortf.selPrint(thisForm.oprinter.hdc)
I can't tell you how to change printers or any other details of the VBPrinter.ocx, but I am able to print from richTextControl using this class.
HTH,
Steve Gibson