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


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

Re: How do you test to see if your insertion point is inside a table? by Tony

Tony
Fri Sep 30 09:42:19 CDT 2005

What you want is

Selection.Information(wdWithInTable) = True/False

Enjoy,
Tony


"Henry Stock" <hstock@onproject.com> wrote in message
news:eMA07mcxFHA.464@TK2MSFTNGP15.phx.gbl...
> 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
>
>
> --
> Henry Stock,
> onProject.com
> 3 Wing Drive
> Cedar Knolls, NJ 07927-1006
>
>



Re: How do you test to see if your insertion point is inside a table? by Henry

Henry
Fri Sep 30 13:13:23 CDT 2005

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

"Tony Jollans" <Nomail> wrote in message
news:uyyIA4cxFHA.612@TK2MSFTNGP10.phx.gbl...
> What you want is
>
> Selection.Information(wdWithInTable) = True/False
>
> Enjoy,
> Tony
>
>
> "Henry Stock" <hstock@onproject.com> wrote in message
> news:eMA07mcxFHA.464@TK2MSFTNGP15.phx.gbl...
> > 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
> >
> >
> > --
> > Henry Stock,
> > onProject.com
> > 3 Wing Drive
> > Cedar Knolls, NJ 07927-1006
> >
> >
>
>



Re: How do you test to see if your insertion point is inside a table? by Klaus

Klaus
Fri Sep 30 14:08:23 CDT 2005

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