George MacKerron: code blog

GIS, software development, and other snippets

Paste unformatted keyboard shortcut in Office 2008 for Mac

with 26 comments

iWork and some other Mac apps provide the keyboard shortcut Apple-Alt-Shift-V for the extremely useful command Edit > Paste and match style. But Office 2008 provides no such equivalent for its equivalent command, Edit > Paste > Unformatted Text > OK. Annoying.

Happily, you can fix this with a strategically named and placed AppleScript. Open /Applications/AppleScript/Script Editor, and paste in the following lines:

tell application "Microsoft Word" 
  paste special (text object of selection) data type paste text
end tell

Save in /Users/YourUserName/Documents/Microsoft User Data/Word Script Menu Items as Paste unformatted\mosV.scpt (the backslashed bit at the end of the filename provides the shortcut). Restart Word and you can now paste without importing extraneous styles with Apple-Alt-Shift-V.

Update

You might also try this alternative approach (via a handy comment elsewhere):

try
  set theClip to Unicode text of (the clipboard as record)
  tell application "Microsoft Word" to tell selection to type text text theClip
end try

This has the advantage of leaving the cursor where you expect, at the end of the pasted text — the original script fragment leaves it at the beginning. And no, type text text is sadly not a typo: that’s really how Word likes to be addressed.

Written by George

May 19th, 2009 at 4:35 pm

Posted in Mac

26 Responses to 'Paste unformatted keyboard shortcut in Office 2008 for Mac'

Subscribe to comments with RSS or TrackBack to 'Paste unformatted keyboard shortcut in Office 2008 for Mac'.

  1. Thanks for the tip. Works great.

    TJJ

    16 Jun 09 at 7:45 pm

  2. Great tip. However, since I ALWAYS paste as unformatted text, I changed the script name to mV.scpt. This now overrides the default behavior of command-V (default to Paste as formatted text) to render all paste commands as unformatted text. In Word, this text will automatically assume the style attributes of the section into which the text is pasted.

    I find the command-alt-shift-v combination awkward, but the command-V is deeply embedded in muscle memory…

    Again, thanks for the tip!

    virusdoc

    8 Jul 09 at 9:16 pm

  3. Works great! Thank you soo much!!

    Jon

    4 Aug 09 at 2:29 pm

  4. I would also like to make it the default behavior, but I’ve never written an apple script before. Can someone give me the steps for doing what virusdoc suggests above?

    Stephanie Dray

    17 Aug 09 at 7:32 pm

  5. second script works perfectly with Word. But trying it with Excel 2008 doesnt work. I tried to replace “Microsoft Word” with “Microsoft Excel” but that just gives me errors when saving it to Excel script menu items (syntax error…)

    Anyone can help that would be great, thanks

    cam

    30 Aug 09 at 11:34 pm

  6. Cam, I also tried to revise the script for Excel. Does anybody know how to do this?

    Also, I modified the filename ending to msV.scpt, eliminating the O so I wouldn’t have to hit the Alt key – Command-Shift-V is so much more natural.

    Usually I use Menu Master to create keyboard shortcuts, so Microsoft’s Malicious Mac Mouse-iness is more or less dead to me – maybe completely now.

    Thank you for providing this script, George.
    You saved me from the painful mouse and menu workflow, which is the ONLY thing I find frustrating about Mac’s Excel 2008. (Though I am still praying for Office for Mac to give us the advanced Conditional Formatting that Excel 2007 Windows introduced – it kicks sooo much nerdy ass.)

    Anyone have solutions to the Excel shortcut or an add-on for conditional formatting?? Hit me up via my website.

    caneel joyce

    21 Nov 09 at 12:48 pm

  7. Just found out how to DO THE SAME IN EXCEL!

    You will find the script here:
    http://www.owczarek.com.pl/blog/2009/11/11/automating-ms-office-for-mac-editing-and-pasting/

    macalicous.

    caneel joyce

    21 Nov 09 at 1:03 pm

  8. May you please received thousand thanks for posting such useful scripts for users like me. Simple, efficient and exactly what I was looking for. Thanks again for sharing your skills.

    chloroplast73

    30 Nov 09 at 1:28 am

  9. Cannot begin to tell you how useful this has been for me. Thank you!

    Patrick

    13 Dec 09 at 9:07 pm

  10. Works like charm. Thanks a lot!!!

    Michael

    2 Jan 10 at 7:01 pm

  11. Thanks a lot! It works, but is it slow for everybody? It takes a full 2 seconds to paste the unformatted content.

    Olivier L.

    6 Jan 10 at 5:10 pm

  12. Thanks–works great.

    Adam Gorley

    15 Jan 10 at 8:07 pm

  13. Fantastic tip, thank you (I used the alternative version).

    Also, easiest way to get the script in the right place is to go into Word, select the script drop-down menu, select “About this menu …” and then “Open folder.” Now drag/drop your saved script into that folder. For me, I didn’t even have to restart for it to start working.

    Mat

    19 Jan 10 at 1:11 pm

  14. Terrific. Just what I needed. Thanks.

    Eric

    21 Jan 10 at 6:26 am

  15. Does anyone have a script solution for Powerpoint 2008? I have attempted to use the above example for Word 2008 – but sadly it gives me an error on the ‘text text’ portion.

    Thoughts?

    Tinto

    22 Jan 10 at 11:00 am

  16. Cheers! that was super helpful!

    Kn

    28 Jan 10 at 1:26 pm

  17. Brilliant! An issue which has been annoying me for years is finally solved.

    Slim

    2 Mar 10 at 12:44 am

  18. Thanks you – super helpful.

    Jon

    14 Mar 10 at 8:12 pm

  19. Thanks that was super useful. I’ve been looking for this tip forever.

    Iye

    16 Mar 10 at 5:29 pm

  20. Hey, thanks for this! Saves me a ton of time! Well done.

    Patrick

    22 Apr 10 at 7:35 pm

  21. Like Tinto, I need an Applescript keystroke that will Paste Unformatted in Powerpoint 2008. I have tried various options for Word, replacing “Word” with “PowerPoint”, but get the same error message.

    Guy

    23 Apr 10 at 3:36 am

  22. You are a life-saver!

    Boom

    6 May 10 at 6:54 pm

  23. Hi, for the dummies amongst us: I have changed it to “Paste unformatted\oV.scpt”. I can live with “Alt-V”, but any chance you beautiful people will tell me how to change it to “Ctrl-V”?

    Tx!

    Tom

    22 May 10 at 10:12 am

  24. I believe character mapping for the modifier keys are:
    c = ctrl,
    o = option/alt,
    s = shift,
    m = command

    “\cV.scpt” should give you the Ctrl=V shortcut.

    So combine at will.

    Lyle Turner

    25 May 10 at 9:37 pm

  25. Awesome! I’ve been looking all over for a way to do this, but nothing else worked. Thank you!

    Nobody

    6 Jun 10 at 4:23 am

Leave a Reply

Preview: