Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

Parse Document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arthur Yuen - 03 Apr 2007 03:16 GMT
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
Jonathan West - 03 Apr 2007 15:45 GMT
> Dear all,
>
[quoted text clipped - 5 lines]
> 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.

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.