Paste Special Macro

P

Patrick_CH

I wonder if it is possible to create/record a macro to
Paste Special unformatted text. I tried it via the Record
Macro function, but without success...
 
S

Shyam Pillai

Patrick,
You haven't mentioned the version of PowerPoint. It's straightforward in PPT
2002 and later.

ActiveWindow.Selection.ShapeRange(1).TextFrame.TextRange.PasteSpecial(ppPasteText)
or
ActiveWindow.Selection.TextRange.PasteSpecial(ppPasteText)
-
Regards
Shyam Pillai

Secure Pack: http://www.mvps.org/skp/securepack/
 
G

Guest

Shyam,

Thanks for your answer! The version of Powerpoint I am
using is 2000 and when I try your lines, I get a message
saying: Compile error: Method or data member not found,
highlighting "PasteSpecial". Is there a workaround?

Regards
Patrick
 
S

Shyam Pillai

In PPT 2000 you have two choices:
Either set a reference to the Microsoft Forms 2.0 object library (Tools |
References...) and then run this code:

Dim oCB As DataObject
Set oCB = New MSForms.DataObject
oCB.GetFromClipboard
ActiveWindow.Selection.TextRange = oCB.GetText

or use the function GetClipboardDataAsString() on the following page:
http://www.vbaccelerator.com/home/VB/Tips/Read_A_Custom_Clipboard_Format/article.asp
by invoking as follows.

ActiveWindow.Selection.TextRange = GetClipboardDataAsString(0,1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top