Hi =?Utf-8?B?S2VuIEgu?=,
I am looking for some kind of macro that would take care of the following
for pasting from Excel to Word 2002. Need to do the default paste (I think
it is in RTF) - then select the newly pasted table - and finally, apply the
<AutoFit to Contents> property to the table. This would fix the difference
between Word 2000 and Word 2002 when copying and pasting from Excel and
allow a single click paste that preserves the formatting.Actually, the default format is HTML. Sometimes, that's good, other times,
not. If the paste is a link, that's quite easy to change. You don't mention
whether you want a link?
Sub PasteXLandFormatTable()
Dim rng As Word.Range
Set rng = Selection.Range
rng.Paste
rng.Tables(1).AllowAutoFit = True
End Sub
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail