Macro for Paste Special Unformatted Text

J

Julie27

I'm copying and pasting a lot of emails into one Word document. To
save steps, I created a macro to paste special unformatted text, but
it's not working right. It's pasting but not in unformatted text
form. My macro is:

Sub PasteUnformattedText()
'
' PasteUnformattedText Macro
' Macro recorded 12/22/07 by Baird Julianne
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

I searched these discussion threads and found this macro for the same
action

Selection.PasteSpecial Link:=False, DataType:=wdPasteText,
Placement:= _
wdInLine, DisplayAsIcon:=False

I copy and pasted those lines over my Macro commands but received an
error message.

Why isn't this working? I will admit I'm not very swift at creating
Macros.

Julie
 
J

Julie27

Thanks, Clive. I'll spend some time tomorrow reading through "Bend
Word to your Will." I copied the macro and pasted it into my document
applying it to the normal template. Unfortunately my keyboard
shortcut isn't working with it. If I don't find an answer in your
document, I'll post a reply back here. I'd like to figure out this
part on my own if I can. It will help me understand Word better.
By the way, Word 2008 will not have macro capability.

I wasn't planning on buying Word 2008 until I have problems opening
documents people send me. Although I'm just learning about Macros, I
can see how they are wonderful time savers. Too bad they aren't
included in the next version.

Julie
 
D

Daiya Mitchell

Hi Julie,

Couple issues. If you recorded a Paste Unformatted Macro, it comes out
wrong. The recorder is broken for things involving Paste Special.

The macro you post should be fine, but I'm guessing the line break is in
the wrong place. You see where there is an underscore: _ ? Really the
underscore means "this underscore of _ should not exist and this should
all be one line." So try using the VBA editor to type all that as a
single line, and let it add an underscore if it needs to. In addition,
copying stuff from the web might include a line break that isn't the
same as the line break the VBA editor would use. I'd bet money that is
the problem. Some judicious backspacing should fix it.

Also, you can see here for a functional macro and instructions on fixing
errors.
http://word.mvps.org/Mac/PasteText.html
(the one you have might be a little better, but that one has never
failed me)
http://word.mvps.org/Mac/InstallMacro.html

The keyboard shortcut issue---the keyboard shortcut is not hard-coded as
part of the macro. You might need to re-assign it to a new macro.

While macros are not included in Word 2008, the AppleScript support is
better. For a home user, substituting AppleScript for Macros might be
just as efficient, once set up.

Daiya
 
L

little_creature

Hi,
maybe I have missed something but why do you need macro? why not to
simply assign a shortcut to pasteSpecial command? This works quite OK
for me and the advantage is that I do not unnecessarily put macros to
files, which I would be a bit careful if you share files with other
people.
 
J

Julie27

Thanks to all who had helpful tips and answers but especially to Clive
for his answers and his tome of knowledge about Word. I learned lots
while perusing through "Bend Word to your Will." There's still lots
to read and lots to learn. :)

I believe I conquered this problem. I added a special paste button
based on the macro to "Julie's toolbar." It works and it's a wonderful
time saver. I'm still playing with the keyboard shortcut, but for now
I'm happy with a button on the toolbar.

Thanks again!

Julie
 
D

Daiya Mitchell

Julie27 said:
I'm still playing with the keyboard shortcut, but for now
I'm happy with a button on the toolbar.

I think when you record a macro, it offers you a chance to assign a
keyboard shortcut. This has never worked for me. I always just create
the macro, then go into Tools | Customize. On the left, there is a
category for Macros--then you can assign the shortcut.

Glad you are pretty much sorted.

Daiya
 
C

Clive Huggan

I think when you record a macro, it offers you a chance to assign a
keyboard shortcut. This has never worked for me. I always just create
the macro, then go into Tools | Customize. On the left, there is a
category for Macros--then you can assign the shortcut.

Glad you are pretty much sorted.

Daiya

Same for me. Additionally, I sometimes Control/right-click the toolbar
button, even if it¹s greyed out. In the contextual menu that appears, select
"Properties" » click the "Keyboard" button. You can also shorten or change
the button¹s title while you¹re there.

I also add a comment in the macro itself (i.e., preceded by a single
quotation mark) showing what keyboard shortcut I assigned.

Cheers,

Clive
======
 
J

Julie27

... I sometimes Control/right-click the toolbar
button, even if it¹s greyed out. In the contextual menu that appears, select
"Properties" » click the "Keyboard" button. You can also shorten or change
the button¹s title while you¹re there.

This is how I got the keyboard shortcut to work. I probably won't use
it now that I have a button on the toolbar but at least I learned how
to add a keyboard shortcut after the macro was created.

I also add a comment in the macro itself (i.e., preceded by a single
quotation mark) showing what keyboard shortcut I assigned.

I hadn't thought of this. Still learning the tricks to make Word more
Julie-friendly. I don't need it to be user-friendly, just Julie-
friendly. I'm the only one who uses my Mac laptop. My hubby can live
with his PC.

Julie
 
C

Clive Huggan

This is how I got the keyboard shortcut to work. I probably won't use
it now that I have a button on the toolbar but at least I learned how
to add a keyboard shortcut after the macro was created.



I hadn't thought of this. Still learning the tricks to make Word more
Julie-friendly. I don't need it to be user-friendly, just Julie-
friendly. I'm the only one who uses my Mac laptop. My hubby can live
with his PC.

Julie

Spot on, Julie!

Now and again I have to work on my wife's / children's / granddaughter's
Macs (we are, um, a somewhat Mac family, although there are a few PCs
hanging around). And because those computers don't have my customizations
(especially Word's extensive AutoCorrect items), I'm almost struck dumb...

Just remind your hubby what "P" stands for in "PC". :))

Cheers,

Clive
======
 
J

Julie27

Just remind your hubby what "P" stands for in "PC". :))

My husband doesn't have the desire or need to personalize items on his
computer. He uses it for basic items such as emails, upload pictures,
an occasional letter, web browsing, etc. He's content with the way
things work and when something doesn't he calls me. It's nice to be
needed. :) I on the other hand am happy to personalize my Mac and
change setting so that they suit me. I'm very grateful I don't have to
share my laptop.

Julie
 
D

Daiya Mitchell

Julie27 said:
I probably won't use
it now that I have a button on the toolbar

Side note--in Word 2004, when you paste, a Paste Options button should
show up at the end of the pasted text. This is a clipboard icon that you
can click on and select Keep Text Only or Match Destination Format. It
only shows up right after hitting paste.

I forget which version you are in, but I mention this because, from my
point of view, the Paste Options button is nearly as efficient as a
button on the toolbar (click vs. hover plus click), so perhaps you are
not aware of it? It may need to be turned on via Word | Preferences |
Edit, check "show paste options buttons" I use the macro, plus keep the
button turned on in case I change my mind about somethinng.

Or that is likely to do the job for anyone reading the archives who
doesn't want to mess with macros.

Daiya
 
J

Julie27

Side note--in Word 2004, when you paste, a Paste Options button should
show up at the end of the pasted text. This is a clipboard icon that you
can click on and select Keep Text Only or Match Destination Format. It
only shows up right after hitting paste.

Thanks Dalya for this reminder. You might be more coordinated than I
am but I find that button frustrates. It could be because I'm typing
on a 12" PowerBook and nothing is big on this screen. It takes me a
while to get the mouse to that exact point where I can click on the
down arrow and select the formatting option I want. It was actually
easier for me to go to Edit > Paste Special > unformatted Text. It
wasn't faster but I found it less frustrating than using the Paste
Options Button that shows up immediately after pasting text.

One of the nice features of computers and also of Word is that there
are often multiple ways to get the same results.

Julie
 
C

Clive Huggan

Thanks Dalya for this reminder. You might be more coordinated than I
am but I find that button frustrates. It could be because I'm typing
on a 12" PowerBook and nothing is big on this screen. It takes me a
while to get the mouse to that exact point where I can click on the
down arrow and select the formatting option I want. It was actually
easier for me to go to Edit > Paste Special > unformatted Text. It
wasn't faster but I found it less frustrating than using the Paste
Options Button that shows up immediately after pasting text.
Umm, that was the reason I didn't even mention the blue flash thingy. Can't
stand it; I disabled it long ago. ;-)
One of the nice features of computers and also of Word is that there
are often multiple ways to get the same results.

Yes, once you get past the bits that Marketing put in to dazzle the new
purchaser for a few milliseconds, and preferably disable them, Word is quite
the most wondrous, multi-skilled prodigy!

Clive
=====
 
D

Daiya Mitchell

Julie27 said:
Thanks Dalya for this reminder. You might be more coordinated than I
am but I find that button frustrates. It could be because I'm typing
on a 12" PowerBook and nothing is big on this screen.

I've gone back and forth on appreciating vs. hating this thing. I'm
currently appreciating, until it gets stuck and refuses to get out of my
way.

I've got a 15-in powerbook, but I dumped the trackpad for an external
mouse long ago--might be improving my coordination.

Daiya
 

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