Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing the contents of a Rich Text Field

Status
Not open for further replies.

Rob999

Programmer
May 23, 2002
98
US
Hello all. I've put the contents of my help files into a rich text field and would like to allow my Excel 2002 users to be able to print the topic, or a selected section of the topic, from the field which is embedded on a form.

I've looked, and I can't find a way to do that. Any ideas on how to get the user's default printer to print out the info? Thanks!
 
Hi,

This might work...

Create a new form, UserForm2, which contains a single TextBox the same size as the form, assign the value to the appropriate TextBox source and then use the PrintForm method.
From UserForm1...
Code:
Private Sub UserForm_Click()
    TextBox1.Value = "Now is the time for all good men to come to the aid of their country"
    With UserForm2
        .TextBox1.Value = TextBox1.Value
        .PrintForm
    End With
End Sub
Hope this helps :)

Skip,
Skip@TheOfficeExperts.com
 
Thanks Skip. I needed to stay in an RTF because I have screen shots, so what I ended up doing (more of a work around than the right way, I'm sure) was closing the rtfWindow.FileName in the rtfTextbox, opening up an instance of Word via automation, doing a "WdApp.PrintOut" call on the file, closing the instance of Word and finally resetting the rtfWindow.FileName to the same file. The rtf blinks white for a split second while it prints then returns, so that's no problem. Also, I broke the help up into several topics and have the user select a topic at a time, and each topic is a separate, smaller file. Not HTML Help, but it works for now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top