Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Macro for Paste Special Unformatted Text
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^ |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
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. |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
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. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looking for a shortcut for Paste Special Unformatted Text | Microsoft Word Help | |||
paste special unformatted text | Microsoft Word Help | |||
paste special - unformatted text | Microsoft Word Help | |||
shortcut key for paste special > unformatted text | Microsoft Word Help | |||
Is paste special the only way to insert unformatted text | Microsoft Word Help |