How to work out Top, Left of InlineShape?

S

Simon Woods

Hi

I'm struggling to work out the above.

My range is a combination of text and inlineshapes like this. Please excuse
the rough drawing
_______
| |
abcdefg| |
|______ |

I am working through each character to try and determine the leftmost,
topmost, rightmost and bottommost coordinates.

I was trying the

InlineShape(1).Range.Information(wdVerticalPositionRelativeToPage)

as I thought that would give me the TopMost, but it returns exactly the same
value as if I call it against one of the preceding characters.

So is there a call (or perhaps some maths) to work this out?

Thanks

Simon
 
J

Jonathan West

Simon Woods said:
Hi

I'm struggling to work out the above.

My range is a combination of text and inlineshapes like this. Please
excuse the rough drawing
_______
| |
abcdefg| |
|______ |

I am working through each character to try and determine the leftmost,
topmost, rightmost and bottommost coordinates.

I was trying the

InlineShape(1).Range.Information(wdVerticalPositionRelativeToPage)

as I thought that would give me the TopMost, but it returns exactly the
same value as if I call it against one of the preceding characters.

So is there a call (or perhaps some maths) to work this out?

This is a far from simple calculation. What this function gives you is the
position of the topmost part of the highlighted area if you select and
highlight the whole line. Therefore the value you get from the shape will;
be the same as you get from the adjacent character.

Neither is *necessarily* the position of the shape itself. If the shape is
on the first line of a paragraph and the paragraph has some Space Before
set, then the top of the highlighted area includes the Space Before.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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