Hi,

I'm wanting to create a macro to change the font in all text boxes with a
document. I'm guessing I need to select each box and change the
properties....one at a time. Each document has different types of objects
(Select All doesnt work).

If any one can help with code so make a simple loop macro, I'd appreciate
it.

Thanks
Santa

Re: Looping through text boxes to change font by Jean-Guy

Jean-Guy
Thu Sep 29 09:35:12 CDT 2005

Santa Claus was telling us:
Santa Claus nous racontait que :

> Hi,
>
> I'm wanting to create a macro to change the font in all text boxes
> with a document. I'm guessing I need to select each box and change the
> properties....one at a time. Each document has different types of
> objects (Select All doesnt work).
>
> If any one can help with code so make a simple loop macro, I'd
> appreciate it.
>

Try this (There are two loops in case some of the Textboxes are inline with
the text):

Dim myShape As Shape
Dim myInlineShape As InlineShape

For Each myShape In ActiveDocument.Shapes
With myShape
If .TextFrame.HasText Then
.TextFrame.TextRange.Font.Bold = True
End If
End With
Next

For Each myInlineShape In ActiveDocument.InlineShapes
With myShape
If .TextFrame.HasText Then
.TextFrame.TextRange.Font.Bold = True
End If
End With
Next



--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org



Re: Looping through text boxes to change font by Jonathan

Jonathan
Thu Sep 29 08:08:23 CDT 2005

Hi Santa

Something like this should put you on the right track

Dim oShape as Shape
For each oShape in ActiveDocument.Shapes
If oShape.TextFrame.HasText Then
oShape.TextFrame.TextRange.Font.Name = "My new font"
End If
Next oShape

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


"Santa Claus" <santaclausinau@hotmail.com> wrote in message
news:433bd2a5_1@news.iprimus.com.au...
> Hi,
>
> I'm wanting to create a macro to change the font in all text boxes with a
> document. I'm guessing I need to select each box and change the
> properties....one at a time. Each document has different types of objects
> (Select All doesnt work).
>
> If any one can help with code so make a simple loop macro, I'd appreciate
> it.
>
> Thanks
> Santa
>