Advertisement

06.27.2008 at 11:12PM PDT, ID: 23523567
[x]
Attachment Details

Apply another font to all text boxes within a canvas or to grouped text boxes

Asked by AndreasHermle in Microsoft Word, Visual Basic Programming

Tags: Microsoft, Word, 2003

Dear Experts:
Below macro changes all text within text boxes to "arial ,bold, Size 8".  So far, so good. This macro is working

a. But I also got text boxes within canvasses. How do I  have to change the code so that text boxes within canvases also get their font changed to "Arial Bold 8"?
b. I also got grouped text boxes in my document. How do I  have to change the code so that grouped text boxes also get their font changed to "Arial Bold 8"?

Help is much appreciated. Thank you very much in advance. Regards, Andreas


Sub ApplyFontToTextBoxes()
Dim shp As Word.Shape

For Each shp In ActiveDocument.Shapes
With shp.TextFrame
If .HasText Then
  .TextRange.Font.Name = "Arial"
  .TextRange.Font.Size = 8
  .TextRange.Bold = True
End If
End With
Next shp
End SubStart Free Trial
[+][-]06.28.2008 at 05:14PM PDT, ID: 21892474

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Word, Visual Basic Programming
Tags: Microsoft, Word, 2003
Sign Up Now!
Solution Provided By: GrahamSkan
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.30.2008 at 05:37AM PDT, ID: 21898518

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628