PDA

View Full Version : [SOLVED:] How to PasteSpecial Unformatted Text in PP VBA?



Paul_Hossler
02-21-2008, 08:00 AM
OK, I give up -- PowerPoint wins:bug:

I can not figure out something that is SO easy in Word and Excel.

In slide edit mode, I have some text on the clip board (maybe from PP, maybe some where else). I just want to paste it in a placeholder textrange, but without the formatting from the source.

Easy to do -- Edit, PasteSpecial, Unformatted

I have the "PasteSpecial..." on my toolbar, but I'd like replace that with a macro that will just automagically pastes the source text without formatting so that I can just click a button.

Thanks

Paul

TrippyTom
02-21-2008, 09:13 AM
This is what I use:


Sub myPasteSpecial()
On Error Resume Next
ActiveWindow.View.PasteSpecial DataType:=ppPasteText, displayasicon:=msoFalse, link:=msoFalse
End Sub


However, I must point out it's still not exactly unformatted text. It's based on whatever format your text is in when you right click a shape (or textbox) and choose "set autoshape defaults". It turns out that this is a handy "accident" because you can use this macro to paste as 8pt arial, then change it to something else to paste everything as 10pt Verdana, etc.

Paul_Hossler
02-21-2008, 02:49 PM
Works well - I can never get the hang of ActiveWindow, View, etc. and when to use them. Wish the macro recorder was as good as Excel's.

Thanks

Paul