Parse Document

A

Arthur Yuen

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
 
J

Jonathan West

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
 

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