View Single Post
  #3   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Macro for Paste Special Unformatted Text

Or you could call the data type by name

Sub PasteUnfText()
On Error GoTo oops
Selection.PasteSpecial _
DataType:=wdPasteText, _
Placement:=wdInLine
End
oops:
Beep
End Sub

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org





Jay Freedman wrote:
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.