Code Comments
Programming Forum and web based access to our favorite programming groups.OK, this problem seems like it should be easy to solve, but the solution continues to evade me. I need to put some rtf formatted text into both Word documents and PowerPoint presentations. Word is not an issue, I just use th e following code: Clipboard.Clear Clipboard.SetText uscModAssump_Description.TextRTF, vbCFRTF objWord.Selection.PasteAndFormat wdFormatOriginalFormatting where uscModAssump_Description is an custom ActiveX control that contains an RTF box. PowerPoint presents an issue though. I can manually copy text from an RTF box and paste it into the PowerPoint slide, but when I try to do it programmatically, PowerPoint doesn't recognize the RTF format stored in the Clipboard. I have tried various things to try and work around this issue, but have not had success. The following code should work, but does not. Clipboard.Clear Clipboard.SetText frmMain.rtfExport.TextRTF, vbCFRTF oPPT.ActiveWindow.Selection.TextRange.PasteSpecial ppPasteRTF Any help on this issue would be greatly appreciated. Brian H.
Post Follow-up to this messageSince posting I have found a working solution, it's not elegant, but it works. I place an RTF box on my form, load the text into it, and select the text. Then I use SendKey "^C",True to simulate manual copying and finish with oPPT.ActiveWindow.Selection.TextRange.PasteSpecial ppPasteRTF If anyone has a better solution, I would be thankful still. Brian H. "Brian H." wrote: > OK, this problem seems like it should be easy to solve, but the solution > continues to evade me. I need to put some rtf formatted text into both Wo rd > documents and PowerPoint presentations. Word is not an issue, I just use the > following code: > > Clipboard.Clear > Clipboard.SetText uscModAssump_Description.TextRTF, vbCFRTF > objWord.Selection.PasteAndFormat wdFormatOriginalFormatting > > where uscModAssump_Description is an custom ActiveX control that contains an > RTF box. > > PowerPoint presents an issue though. I can manually copy text from an RTF > box and paste it into the PowerPoint slide, but when I try to do it > programmatically, PowerPoint doesn't recognize the RTF format stored in th e > Clipboard. I have tried various things to try and work around this issue, > but have not had success. The following code should work, but does not. > > Clipboard.Clear > Clipboard.SetText frmMain.rtfExport.TextRTF, vbCFRTF > oPPT.ActiveWindow.Selection.TextRange.PasteSpecial ppPasteRTF > > Any help on this issue would be greatly appreciated. > > Brian H.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.