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
 
Top