image size not change in word

Y

yangjun

I use INCLUDEPICTURE to embed one image url in word 2000,but when I try to
resize the image , it donot work. any one can help me? below is my code:

Set oRange = oBookmark.Range
Set oSel = objWord.Selection

imgurl2 =
"http://support.microsoft.com/library/images/support/enus/protect_123.gif"
fieldtext = "INCLUDEPICTURE"""+imgurl2+""""
oRange.Select()
oSel.Fields.Add oRange, , fieldtext, False
' set img size
oSel.MoveLeft
oSel.InlineShapes(1).LockAspectRatio = msoTrue
oSel.InlineShapes(1).Height = 105.85
oSel.InlineShapes(1).Width = 281.5
Set nShp = Selection.InlineShapes(1).ConvertToShape
oSel.MoveRight
 
D

Doug Robbins

Use the range object that contains the picture rather than the selection
object.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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