Article ID: 170232
Article Last Modified on 11/23/2006
NOTE: If the RichTextBox control is not available on the Toolbox commandbar, click Additional Controls on the Tools menu. Under Available Controls, click Microsoft RichText Control, version 5.0. If it is not listed, you must install the ActiveX controls from either Microsoft Visual Basic 5.0 or from the Microsoft Office 97 Developer Edition.
Private Sub CommandButton1_Click()
Dim RTFString as Object
' Creates a file to receive the RTF information from the control.
Open "RTFText.rtf" for Output As 1
' Places the RTF information from the control into the file and
' closes the file.
Print #1, RichTextBox1.TextRTF
Close 1
' Opens the new file in Microsoft Word and prints it.
Set RTFString = GetObject("RTFText.rtf")
RTFString.Activate
RTFString.PrintOut Background:= False
Set RTFString = Nothing
Unload Me
End Sub
146022 How to Set Up the RichTextBox Control for WYSIWYG Printing
Keywords: kbdtacode kbinfo kbprogramming KB170232