Word 2007 inlineshape scalewidth property always returns 0

E

eerik.lehto

Hi all,

I have some macros to add and adjust images to word documents. The
problem is that I want to scale picture by using percentage values,
but if I'm trying to check the current value of scalewidth or
scaleheight in Word 2007, the property always returns 0. The same
macro works perfectly in Word 2000, XP and 2003. Here is an example
code:

'to try this, you must have a document containing images
Sub Testmacro
ActiveDocument.InlineShapes(1).Select
MsgBox (Str(Selection.InlineShapes(1).ScaleHeight))
End Sub

In other versions of Word, the message box returns the scaling
percentage (ie. 100) but in Word 2007 you always get 0. Is this a bug
in Word 2007?

Kind Regards,

Eerik Lehto
Systems Engineer
Pöyry Forest Industry Oy, Finland
 
P

Perry

In other versions of Word, the message box returns the scaling
percentage (ie. 100) but in Word 2007 you always get 0. Is this a bug
in Word 2007?

Nope, no bug; works great here ...
:)

Pls supply addtl info ...

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE



<[email protected]> schreef in bericht
Hi all,

I have some macros to add and adjust images to word documents. The
problem is that I want to scale picture by using percentage values,
but if I'm trying to check the current value of scalewidth or
scaleheight in Word 2007, the property always returns 0. The same
macro works perfectly in Word 2000, XP and 2003. Here is an example
code:

'to try this, you must have a document containing images
Sub Testmacro
ActiveDocument.InlineShapes(1).Select
MsgBox (Str(Selection.InlineShapes(1).ScaleHeight))
End Sub

In other versions of Word, the message box returns the scaling
percentage (ie. 100) but in Word 2007 you always get 0. Is this a bug
in Word 2007?

Kind Regards,

Eerik Lehto
Systems Engineer
Pöyry Forest Industry Oy, Finland
 

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