Paste Special confusion

H

HONYAKUKA

Word 2003

If I Copy text material on a web page and paste it into word using Edit > Paste
Special > Paste option button > Formatted Text (RTF), the font and paragraph
formatting (specifically, paragraph spacing) are retained in the Word document.

If I run the following macro, however, the paragraph spacing is lost:

*********
Sub PasteSpecialRTF()
Selection.PasteSpecial DataType:=wdPasteRTF
End Sub
*********

(I've omitted certain Error handling for simplicity.)

Why should there be a difference?

What would the code be that is truly equivalent to Edit > Paste Special > Paste
option button > Formatted Text (RTF)?

Incidentally, if I record a macro by pointing to Edit > Paste Special > Paste
option button > Formatted Text (RTF), the recorder creates the following code:

*********
Sub Macro4()
Selection.PasteAndFormat (wdPasteDefault)
End Sub
**********

The Type "wdPasteDefault" is not defined in the Help file under PasteAndFormat
Method. Interestingly, if I record this sequence --- Edit > Paste Special >
Paste option button > Unformatted Text --- I get the same macro, with
"wdPasteDefault".

wdPasteDefault evidently gives you the most recent wdRecoveryType, NOT RTF or
anything else in particular.

Anyway, thanks for any help.

Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top