Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2007 Word Macro to Paste Special Unformatted Text

Status
Not open for further replies.

judgehopkins

Technical User
Mar 23, 2003
780
US
Code:
Sub PasteSpecialUnformatted()
'
' PasteSpecialUnformatted Macro
'
'
    Selection.Collapse Direction:=wdCollapseStart
    Selection.PasteSpecial DataType:=wdPasteText
End Sub

Code:
Sub test()
'
' test Macro
'
'
    Selection.PasteAndFormat (wdPasteDefault)
End Sub

I got the first macro from Word's help files.

When I select text to replace and run the macro, it correctly inserts the contents of the clipboard but does not replace the selected text.

I got the second macro by recording the keystrokes for paste special/unformatted text.

When I select text to replace and run the macro, it correctly inserts the contents of the clipboard and does replace the selected text, but it is not unformatted text.


What am I doing wrong?

Thanks!

There are two guaranteed rules of success: First, never tell everything you know.
 



Hi,

Please post VBA code question in Forum707

Skip,

[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue]
 
Will do...thanks, Skip!

There are two guaranteed rules of success: First, never tell everything you know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top