View Single Post
  #1   Report Post  
Raven95
 
Posts: n/a
Default Possible bug when recording a Word Macro

Good afternoon. I'm having a problem recording a simple macro in Word. I
first noticed this issue in Word XP, and now again in Word 2003. Here is what
I'm trying to do. I want to copy text from a web page and paste it,
unformatted, into Word, regardless of the formatting on the web page.

Here are the steps I'm taking:
1. Copy any text from any web page
2. In Word, start recording a macro
3. I name it PasteSpecial, assign it to the keyboard (Alt+D), and click
Close to start recording
4. I click Edit - Paste Special..., I then select "Unformatted Text" and
click OK. At this point, the text appears pasted the way I want it,
unformatted.
5. I stop the recording and test the macro by pressing Alt+D
6. The text is pasted with whatever formating was included on the web page

Here is the resulting VBA code:
Sub PasteSpecial()
'
' PasteSpecial Macro
' Macro recorded 4/29/2005 by USAAC
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub

The problem is that the macro does not record the selection of "Unformatted
Text," but instead records the default option in the dialog box, which is
"Formatted Text (RTF)," as evidenced by the (wdPasteDefault). It *should*
read (wdFormatPlainText) based on the Unformatted Text selection. I have
recorded the macro using just the mouse or just the keyboard, both with the
same results.

Want to know what's even stranger?? If I try to record this same macro in
PowerPoint, it doesn't record my actions at all!

Here is the resulting VBA code in PowerPoint:
Sub PasteSpecial()
'
' Macro recorded 4/29/2005 by USAAC
'

End Sub


Any help would be greatly appreciated. Thanks!

Bill