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!
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!