Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Clipboard RTF Format - Pasting RTF to PowerPoint
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Brian H.
09-28-04 08:55 PM


RE: Clipboard RTF Format - Pasting RTF to PowerPoint
Since 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.

Report this thread to moderator Post Follow-up to this message
Old Post
Brian H.
09-28-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:30 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.