Solved

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

Posted on 2010-11-22
7
1,261 Views
Last Modified: 2012-05-10
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
Comment
Question by:AndreasHermle
  • 3
  • 3
7 Comments
 
LVL 5

Expert Comment

by:Erk333
ID: 34187901
You can right-click directly on the labels to get the floating text format bar.
0
 
LVL 5

Expert Comment

by:Erk333
ID: 34187917
ahhh....i see your looking for a global chart style edit.....brb : )
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 34188048
Hi Andreas. I think that you have forgotten to attach the document.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
LVL 5

Expert Comment

by:Erk333
ID: 34188569
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
 

Author Comment

by:AndreasHermle
ID: 34188718
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
 

Accepted Solution

by:
AndreasHermle earned 0 total points
ID: 34614758
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
 

Author Closing Comment

by:AndreasHermle
ID: 34824259
I found some source on the internet that exactly matched my macro requirements.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Re-indent word doc 5 49
Word 2010 mail merge 3 99
How to search text in Word documents in Windows 10 3 66
Word 2016 - Two similar docs - one has much larger filesize 8 25
It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question