Return the frame anchored to a given paragraph

M

Mark Tangard

Is there a way in VBA to return the (first/only) frame anchored to a
given paragraph?

I was hoping the Frame object had an Anchor property like a Shape does.
Of course, it doesn't. Is there another way, perhaps by looping through
all the frames in the doc to matching one of them with its "anchoree"
paragraph? I'm stumped. TIA.
 
H

Helmut Weber

Hi Mark,
seems to me that the last paragraph in a frame
has an index that equals the index of the
paragraph it is anchored to minus 1.
 
M

Mark Tangard

Helmut,

You're right! Thanks for this. You should've seen the mess of evil
code I'd begun using -- basically cycling through every paragraph and
comparing vertical page positions. Too embarrassing to post.

Thanks,
MT
 

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