Ungroup graphs in batchs

R

richiwatts

Hi,

As I didn't get an answer to my question about search and replace tex
in Microsoft graphs, i wonder if this is possible?

Is it possible, through a Macro or something, to ungroup all the graph
in a file? That way i will be able to search and replace all the text.

I have a lot of grapghs ad to go through an manually ungroup them woul
take for ever.

Many thanks
Rich
 
K

Kurt

Hi Richi,
Try this in vba. You need to add a reference to ms graph and ms powerpoint.
Kurt

Dim pp As New PowerPoint.Application
Dim slide As PowerPoint.slide
Dim shape As PowerPoint.shape
Dim graph As graph.Chart

For Each slide In pp.ActivePresentation.Slides
For Each shape In slide.Shapes
If shape.Type = msoEmbeddedOLEObject Then
If Left(shape.OLEFormat.ProgId, Len("MSGraph.Chart")) =
"MSGraph.Chart" Then
Set graph = shape.OLEFormat.object
If graph.HasTitle Then
graph.ChartTitle = "New title"
End If
End If
End If
Next
Next
 
K

Kurt

Hi Richi,
Try this in vba. You need to add a reference to ms graph and ms powerpoint.
Kurt

Dim pp As New PowerPoint.Application
Dim slide As PowerPoint.slide
Dim shape As PowerPoint.shape
Dim graph As graph.Chart

For Each slide In pp.ActivePresentation.Slides
For Each shape In slide.Shapes
If shape.Type = msoEmbeddedOLEObject Then
If Left(shape.OLEFormat.ProgId, Len("MSGraph.Chart")) =
"MSGraph.Chart" Then
Set graph = shape.OLEFormat.object
If graph.HasTitle Then
graph.ChartTitle = "New title"
End If
End If
End If
Next
Next
 
K

Kurt

Hi Steve,
Yes I know. It was a bit confusing but his original question was about
changing text in a chart (the unanswered one)... Couldn't harm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top