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 / September 2005

Tip: Looking for answers? Try searching our database.

How do you test to see if your insertion point is inside a table?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Henry Stock - 30 Sep 2005 15:17 GMT
Would sombody please give me a hint on how to do this?

I have a 300 page word document that I am supposed to use as the basis for
building a help project.
The document has many images in it, many that allow word wrapping.  This
doesn's convert very well
to the html format that I have to use for the help, so I want to build a
macro that will search for all images and
allow me to enclose these images inside tables and left align both the
tables and images

One of the issues that I face is that some of the images are already inside
a table and for these I do not want to
add yet another surroundng table.  But I don't know how to test to see if my
selection is inside a table.

The code below I got from just recording a macro.  This finds and selects
images.

  Selection.Find.ClearFormatting
   With Selection.Find
       .Text = "^g"
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindContinue
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute

Signature

Henry Stock,
onProject.com
3 Wing Drive
Cedar Knolls, NJ 07927-1006

Tony Jollans - 30 Sep 2005 15:42 GMT
What you want is

Selection.Information(wdWithInTable) = True/False

Enjoy,
Tony

> Would sombody please give me a hint on how to do this?
>
[quoted text clipped - 35 lines]
> 3 Wing Drive
> Cedar Knolls, NJ 07927-1006
Henry Stock - 30 Sep 2005 19:13 GMT
Thanks Tony.  That did help.

Do you by any chance know why my search clause would miss some images and
not others?
It seems like not all the images I see in the document get hit on by the
search mechanism.

Another thing I am curious about is why,when the document is saved as html
some images end up as .png files while others end up as .jpg.  If there were
a way to control this I would prefer all .jpg

> What you want is
>
[quoted text clipped - 44 lines]
> > 3 Wing Drive
> > Cedar Knolls, NJ 07927-1006
Klaus Linke - 30 Sep 2005 20:08 GMT
Hi Henry,

> Do you by any chance know why my search clause would miss some images
> and not others?
> It seems like not all the images I see in the document get hit on by the
> search mechanism.

EditFind can only find pictures that are inline with the text (inline
shapes). For others, you'd need to look at the Shapes collection.

> Another thing I am curious about is why,when the document is saved
> as html some images end up as .png files while others end up as .jpg.
> If there were a way to control this I would prefer all .jpg

I don't think you can influence that. It probably depends on the original
format.
You might ask in the word.drawing.graphics group though.

Greetings,
Klaus

Rate this thread:






 
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.