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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Rich Text onto the Clipboard

Status
Not open for further replies.

dqrose

Technical User
Mar 17, 2006
24
GB
Hi,

I want to copy the contents of a VB5 RichTextBox into MS Word. My RichTextBox is called MyRTFBox. If I use

Clipboard.SetText = MyRTFBox.SelText

and then either Edit | Paste or <Cntl>-V in Word then I lose all the rich text formatting. If on the other hand I use

Clipboard.SetText = MyRTFBox.SelRTF

and then paste it into Word as above then I get an unformatted document with all the RTF codes. Neither of these is what I want.

I can get exactly what I want simply by using <Ctrl>-C to copy the contents of the RTF box into the clipboard, and then pasting the clipboard into Word as described above - so I suppose I need to know what VB5 command reproduces the effect of typing <Ctrl>-C. Can anybody tell me what that is please?

Many thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top