Arthur Yuen said:
Dear all,
I have document contains text, pictures and bullets etc.
How can I use VBA to parse elements one by one?
To check if some text next to picture or a picture next to text.
Thanks alot.
Arthur
Hi Arthur,
Pictures in the document are members either of the Shapes collection (if
they are floating) or the InlineShapes collection.
A Shape object has an Anchor property which defines which paragraph is it
attached to. That isn't necessarily the paragraph closest to the shape on
the page - the shape may be somewhere else on the page, through you can
guarantee that it is at least on the same page.
An InlineShape has a Range property defining where in the text it is. It
should be quite straightforward to find out what text is nearby.
--
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