Word 2007 bug: Inlineshapes(1).scale width returns 0

J

jkorchok

The following code runs correctly in Word 2003, but always returns 0 in Word 2007.

Sub AAScaleWidth()
Dim SelectedPicture1 As InlineShape
Set SelectedPicture1 = Selection.InlineShapes(1)
MsgBox SelectedPicture1.ScaleWidth
End Sub

The same thing happens with ScaleHeight. Is there a known workaround for this bug?

John
 
S

scott.allen.pe

I have Excel 2010, and I have the same problem as John.

I've been trying to figure out how to get my embedded Excel links in Word to be the correct proportions. It inserts at about 97% height and 105% width. As far as I can tell from searching, this has been a problem with Word forever, and all the "fixes" don't work.

So, I tried to write a VBA routine that inserted the Excel link, changed the size to be 100% both directions. Unfortunately, .Reset does not work, and using .ScaleWidth = 100 and .ScaleHeight = 100 does not change anything. (.ScaleWidth = 99 will change it, but then .ScaleWidth = 100 will revert back to the incorrect 105%, not 100%!)

When I do a message box like John, it returns 0.
 
S

scott.allen.pe

Sorry, I have Excel 2010 AND Word 2010, and I have the same problem as John.
 

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