![]() |
|
#1
|
|||
|
|||
![]()
Hi folks, nice to be here. I'm new to the forum but I've been using Word for quite a while. This is a stumper though, since it's a scripting issue. I'm trying to make a macro that pastes unformatted text. I often have to paste something into a document from another source that has a lot of formatting I want to get rid of. It’s a bit cumbersome to go to Home > Paste > Paste Special, etc. every time. I’ve tried creating a macro to do this but it always pastes the formatted text instead. Am I missing a step?
Thanks, Andacar |
#2
|
||||
|
||||
![]()
Hi Andacar,
Without seeing your code, it's hard to say what you might be doing wrong. However, there is a simpler way: simply go to Word Options > Advanced > Cut, Copy & Paste and set the 'Pasting from other programs' parameter to 'Match destination formatting'. For a macro solution, try: Code:
Sub PasteUnformattedText() ' The next line is in case there's nothing in the Clipboard On Error Resume Next Selection.PasteSpecial DataType:=wdPasteText End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Ah, I see. I was just running the macro recorder and selecting the option for unformatted text. But now that I look at the script I can see it just used the default formatting. Thanks.
Andacar |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create macro to paste text after style? | Srivas | Word | 0 | 03-16-2010 05:28 AM |
Selected text and logo in one macro | marijke | Word VBA | 0 | 08-24-2009 07:01 AM |
![]() |
MikeWM | Word VBA | 1 | 08-20-2009 06:21 PM |
![]() |
p3aul | Word | 9 | 08-18-2009 12:42 AM |
![]() |
heron | Word | 1 | 12-06-2005 02:37 AM |