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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word2003 macro recorder produces wrong code

Status
Not open for further replies.

ylustrata

Technical User
Aug 13, 2002
80
0
0
US
I recorded a macro:
Crtl-A
Crtl-C
Edit > Paste Special ... unformatted Text

The code generated was:
Selection.WholeStory
Selection.Copy
Selection.PasteAndFormat (wdPasteDefault)

When I ran the macro again I didn't get the expected results. I was trying to convert a numbered list into an unformatted one.

Also I recorded a macro in which I used Edit to change nn. to Bold nn. by specifying bold in the formatting for the replacement. But the resultant code did not show any sign of bold for the replacement. Again running the macro did not produce the results I wanted.

Using Microsoft Office Word 2003 (11.6359.6360) SP1
 
Hi ylustrata,

Change the last line to:
Selection.PasteSpecial DataType:=wdPasteText

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top