Moving picture changes anchor?

R

Rolf Westly

I do the following in my Word 2003 VBA code:

dim anch as range
activedocument.bookmarks("Start").Select
set anch = selection.range
addpicture(pic, false, true, 0, 0, 100, 100, anch)

(the bookmark is inside a tablecell)

When I check the left and top properties of the shape (the picture) they are
both 0(as I would expect). RelativeHorizontalPosition and
RelativeVerticalPosition are both wdRelative.....PositionColumn.

But if I move the upper left corner of the picture to the lower right corner
of the original picture position I thought I should have left = 100 and top =
100. But Left is 288 and top 99.

Why? Is there any way I can have Left and Top remain relative to the anchor?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Um9sZiBXZXN0bHk=?=,

I take it you're doing the moving in the UI, not with code?

Go into the Format dialog box for the picture, Layout/Advanced. The more
detailed position information is in there. Is "Move with Text" activated after
your code has inserted the picture? And after you've moved it?

As a general rule, as soon as you move something using the mouse, it will tend
to position the object relative to the page, and not to the anchoring text,
unless you do it over this dialog box.
I do the following in my Word 2003 VBA code:

dim anch as range
activedocument.bookmarks("Start").Select
set anch = selection.range
addpicture(pic, false, true, 0, 0, 100, 100, anch)

(the bookmark is inside a tablecell)

When I check the left and top properties of the shape (the picture) they are
both 0(as I would expect). RelativeHorizontalPosition and
RelativeVerticalPosition are both wdRelative.....PositionColumn.

But if I move the upper left corner of the picture to the lower right corner
of the original picture position I thought I should have left = 100 and top =
100. But Left is 288 and top 99.

Why? Is there any way I can have Left and Top remain relative to the anchor?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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