View Single Post
  #2   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Macro for Paste Special Unformatted Text

On Wed, 10 Sep 2008 17:34:35 -0400, "WSR" wrote:

XP SP3
Word 2007

Below is my macro of Paste Special / Picture Enhance Metafile.

Can someone help me modify it for Paste Special / Unformatted Text

Sub PasteSpecialPicture()
'
' PasteSpecialPicture Macro
'
'
Selection.PasteSpecial DataType:=9
End Sub


Thanks for reading and your assistance B^


I think it's more important to point out how to find out these things for
yourself than to solve this particular issue, although we'll get there...

With the cursor in the word PasteSpecial in the VBA editor, press F1 to open the
Help topic for that keyword. In that topic, in the table of parameters, find
DataType. It tells you that this parameter takes a value that's a member of the
WdPasteDataType enumeration, and that word is a hyperlink.

Clicking the link takes you to the topic for WdPasteDataType. There you can find
not only the numeric values but also the names and meanings of the values. In
particular, the value 9 that you already have corresponds to the name
wdPasteEnhancedMetafile. Use the name instead of the number as a form of
internal documentation -- glancing at it tells you what kind of object the
command can paste, without having to look it up.

In the same table, you find that the value wdPasteText (= 2) pastes text.


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.