Office 2003 Excel Paste Special (metafile) to Word Dimensions are Wrong

J

Jamie Carper

When copying Excel data to a Word document, in Office 2003, using
Paste Special with the Metafile format, the rendering of the picture
is in the wrong dimensions.

As a result the fonts do not appear correctly. In fact the Bold
formatting does not appear to be there at all. And the Underline
formatting is being rendered at the wrong horizontal position causing
it to obstruct the text it is associated with. All of this in turn
causes the picture to be smaller and the font characters to be more
spaced apart. This is NOT the case in Office XP.

Using Office XP and 2003, I did some comparisons side by side of the
same exact Word document with the same exact Excel summary imported
using the same exact Excel Addin. I then compared the picture
formatting of the imported data and looked at any differences in
settings. What I found was not good.

The dimensions of the imported (paste-special-metafile) picture were
not the same. Even though in the code I specify a width and height of
54% which in Word 2002 produces a picture Height 6.87 and Width 6.48.
The result in Word 2003 is a picture Height 6.66 and a Width of 6.66.
This "square" result distorts the font rendered.

Additionally I found that the dimensions of the original clipboard
item does not match between Word 2002 ( Height 12.72 Width 12.01 ) and
Word 2003 ( Height 12.33 Width 12.21 ). That's a distortion of 0.39
short in Height and 0.12 excess in Width. In my opinion this is a bug
in Office 2003.

Is anyone else experiencing similar problems? Is there a new setting
in the Paste Special that I am not taking into account? I dont know
where to go with this next. I cannot even find a suitable work-around
at this time except to have all our users (some 300) go back to using
Office XP (2002).

Jamie
 
C

Cindy M -WordMVP-

Hi Jamie,
When copying Excel data to a Word document, in Office 2003, using
Paste Special with the Metafile format, the rendering of the picture
is in the wrong dimensions.
This question doesnt' really belong in a DEVELOPER (programming)
newsgroup. The word.drawing.graphics group might be the better place
to get an answer. The one question that occurs to me is: what command
are you using to COPY the picture in Excel? Have you tried holding
down SHIFT, then clicking the Edit menu to use the Copy as picture
command? That might give better results.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
J

Jamie Carper

Hi Cindy,
This question doesnt' really belong in a DEVELOPER (programming)
newsgroup. The word.drawing.graphics group might be the better place
to get an answer.

First of all 1) I am a Developer who is 2) writing Office automation.
In my research I found this group to be the closest thing to the topic
at hand.

Thus microsoft.public.office.developer.automation
The one question that occurs to me is: what command
are you using to COPY the picture in Excel? Have you tried holding
down SHIFT, then clicking the Edit menu to use the Copy as picture
command? That might give better results.

If the task at hand required "user" activity aka hot-keys I would not
be doing automation. Also I found that the same issues were prevalent
at the interface level.

As for the code I used:

.Range.PasteSpecial DataType:=wdPasteMetafilePicture
.Range.ShapeRange.ScaleWidth 0.54, msoCTrue, msoScaleFromTopLeft
.Range.ShapeRange.ScaleHeight 0.54, msoCTrue, msoScaleFromTopLeft
.Range.ShapeRange.WrapFormat.Type = wdWrapSquare


SOLUTION

As for the problem, I discovered that it did NOT have to do with the
versions after all, but had to do with the Default Printer Driver that
was selected. In my case the default driver on the Office 2003 machine
was "Generic Text". I tested this in Office 2002 as well and got
similar results. Bottom line is that the designers of Office tied the
outcome of Copy and Paste to the Printer Driver.

Obviously they must have a reason for this otherwise I would say it
was and is a poor design. Because now I cannot be certain from user to
user what the outcome will be.

Jamie
 
C

Cindy M -WordMVP-

Hi Jamie,
First of all 1) I am a Developer who is 2) writing Office automation.
OK, sorry about the reaction. There've been a spate of end-user
questions in the developer groups, and there was nothing in your first
message that indicated you were using automation.
As for the problem, I discovered that it did NOT have to do with the
versions after all, but had to do with the Default Printer Driver that
was selected. In my case the default driver on the Office 2003 machine
was "Generic Text".
Thanks for reporting back with this. Yes, Word is very printer-driver
dependent in how it lays out the page and does things. Like you,
though, I find it a bit surprising that this would affect how pictures
are pasted. Good to know and I'm glad you were able to track it down!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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