Object size by copy/paste is different between Office 2003 and 200

F

fmamstr

Currently we are working on an add-in for Excel/PowerPoint/Word using Office
PIA(XP), the workflow is like this:

1) When the target application is Excel, we write our results directly into
Excel.Cell
2) When the target application is Word / PowerPoint, we first write the
results into Excel.Cell, then copy-paste the Excel.Range into Word/PowerPoint
as an static object via CLIPBOARD, but here we met a problem as described
below.

We want to control the "size" of the copy-paste result, we find that we can
get the original size from Excel.Range.Width and Excel.Range.Height. For
paste method, we use
PowerPoint.Slide.Application.ActiveWindow.View.PasteSpecial()
function(PowerPoint, similar for Word). , the return value is the
object(PasteElement) that pasted into Word/PowerPoint and its size could be
manipulated by PasteElement.Width and PasteElement.Height property.
Since we want the result has the 100% ratio of the original one, so we
assign original size to PasteElement.Width and PasteElement.Height, but we
have different behavior in 2003 and 2007 when we test this value from Office
GUI.

In 2007, the final size ratio is 99% which is slightly different from target
value, but In 2003, the final size ratio is 95% of the original one which is
not acceptable for us, so I have 2 questions:

1. Since the code is same for Office 2003 and 2007, why there is such
difference?

2. Is copy/paste a good way to transfer data between different office
application(Excel -> PowerPoint / Word)?

Does anyone know about this? Thanks!
 
F

fmamstr

Thanks Barb.

But it seems the link you provided is not the same thing that I described.
The link mentions about the editing of the "embedded objects", but in my
case, the Excel result is copied into PowerPoint/Word as an STATIC image but
the size is not what I specified in code.

Does anyone know how to control the final size of the image pasted into
PowerPoint/Word?
 

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