[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1285
  • Last Modified:

Change font size of axis labels (etc.) in several charts created in Word 2007 (using VBA)

Dear Experts:

I got dozens of charts created directly in a 2007 document.

I'd like to change the font size of the diagram title, axes and axis labels in one go for all charts.

How is this achieved. I attached a sample file for your convenience.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
0
Andreas Hermle
Asked:
Andreas Hermle
  • 3
  • 3
1 Solution
 
Erk333Commented:
You can right-click directly on the labels to get the floating text format bar.
0
 
Erk333Commented:
ahhh....i see your looking for a global chart style edit.....brb : )
0
 
GrahamSkanRetiredCommented:
Hi Andreas. I think that you have forgotten to attach the document.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Erk333Commented:
the functionality changed somewhat in 2007+ to 'templates' from user-defined chart types.  You can save a desired chart format as a template and apply it to other charts (albeit 1 at a time) but i assume your looking to retain the type (bar, line, pie etc...) and only change some elements like font or color. it would seem a global style or type change is unavailable with out creating some custom VBA in excel and that would seem to be more work than the task requires and it does not really leave room for a style 'change of mind' on the fly.
yes....applying a style element(s) to multiple fields on the fly would be nice functionality to have in the future
0
 
Andreas HermleTeam leaderAuthor Commented:
Dear all,

first of all, thank you very much for your swift help. I will take a look at Erk333's answer later today.

In the meantime I will attach the file I have forgotten to add. Graham, thank you for bringing this to my attention.

Regards, Andreas Charts-Created-in-Word-2007.docx
0
 
Andreas HermleTeam leaderAuthor Commented:
Dear all:

found some source with the solution to the problem.
Sub ModifyWordCharts()
    Dim ilsh As InlineShape
    Dim i As Integer
   
    For Each ilsh In ActiveDocument.InlineShapes
        If ilsh.Type = wdInlineShapeChart Then
            For i = 1 To 2
                With ilsh.chart.Axes(i)
                    If .Type = 1 Then 'Category Axis
                        .TickLabels.Font.Size = 7.5
                    Else 'Values Axis
                        .TickLabels.Font.Size = 9
                    End If
                    .TickLabels.Font.Name = "Arial"
                    .HasMajorGridlines = False
                    .HasMinorGridlines = False
                End With
            Next i
        End If
    Next ilsh
End Sub

Open in new window

0
 
Andreas HermleTeam leaderAuthor Commented:
I found some source on the internet that exactly matched my macro requirements.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now