Paste RTF Into A Cell
George,
I don't have that control, but I think you need to copy the rich text to a clipboard object as rich
text, and paste from there. Your richTextString string variable probably dumps out all the
formatting information.
I'm sure that you can google up some examples...
HTH,
Bernie
MS Excel MVP
"George Lee" wrote in message
...
In VBA I'm trying to paste from a rich text control (RichTx32.ocx) to a
worksheet (Excel 2007) cell but the text always comes out as the unformatted
RTF. How do I paste it so that it appears a properly formatted text?
The code:
Sub RFTTest()
Dim richTextString As String
richTextString = UserForm1.RichTextBox1.TextRTF
Dim myDataObject As New dataObject
Set myDataObject = New dataObject
myDataObject.SetText richTextString ', &HBF01 '(This flag doesn't work
either)
myDataObject.PutInClipboard
Worksheets("Sheet1").Range("D3").Select
Selection.PasteSpecial
End Sub
|