Hi Andreas,
perhaps like that, and
watch out for line continuation:
Sub ApplyFontToTextBoxes()
Dim i As Long ' group items count
Dim l As Long ' shapes.count
Dim x As Long ' a shape's index
Dim y As Long ' a shape's canvas items count
Dim z As Long ' a shape's canvas item index
Dim shp As Word.Shape
l = ActiveDocument.Shapes.Count
For x = 1 To l
i = ActiveDocument.Shapes(x).GroupItems.Count
For z = 1 To i
If ActiveDocument.Shapes(x).GroupItems(z). _
TextFrame.HasText Then
ActiveDocument.Shapes(x).GroupItems(z). _
TextFrame.TextRange.Font.name = "Arial"
End If
Next
If ActiveDocument.Shapes(x).TextFrame.HasText Then
ActiveDocument.Shapes(x).TextFrame. _
TextRange.Font.name = "Arial"
End If
' ActiveDocument.Shapes(x).Select
On Error Resume Next '!
y = ActiveDocument.Shapes(x).CanvasItems.Count
For z = 1 To y
ActiveDocument.Shapes(x).CanvasItems(z). _
TextFrame.TextRange.Font.name = "Arial"
Next
Next
End Sub
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Vista Small Business, Office XP
andreas - 29 Jun 2008 12:38 GMT
> Hi Andreas,
>
[quoted text clipped - 39 lines]
>
> Vista Small Business, Office XP
Dear Helmut,
as always your macros are running just fine. Thank you very much for
your terrific help.
It is always astonishing how quickly you come up with your solutions.
Best Regards and thank you very much again,
Andreas