Chart Layout

S

sylvainpellletier

Hello evrybody,

I run a macro to add the chart layout to some of the slides of a
PowerPoint presentation.
I like to have that zone that just ask you to double clik to add a
chart.
My problem is that I would like to get rid of the title zone. I do not
use it.

Here's my code :

For i = 6 To ActiveWindow.Presentation.Slides.Count

ActiveWindow.View.GotoSlide Index:=i
ActiveWindow.Selection.SlideRange.Layout = ppLayoutChart
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 29").Select
ActiveWindow.Selection.ShapeRange.Delete

Next i

It works fine for the first slide, but not for the others because the
number of the "rectangle" is not different.
The problem is also that the chart shape is a rectangle so I can not
delete every rectangle.

Any idea of where to look ?

Thanks in advance.
 
S

Steve Rindsberg

Hello evrybody,

I run a macro to add the chart layout to some of the slides of a
PowerPoint presentation.
I like to have that zone that just ask you to double clik to add a
chart.
My problem is that I would like to get rid of the title zone. I do not
use it.

Here's my code :

For i = 6 To ActiveWindow.Presentation.Slides.Count

ActiveWindow.View.GotoSlide Index:=i
ActiveWindow.Selection.SlideRange.Layout = ppLayoutChart
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 29").Select
ActiveWindow.Selection.ShapeRange.Delete

Next i

Try this instead, Sylvain. It'll only make it a chart layout and delete the
title IF there's a title there. You could change it to change the layout in a
different section of the code if you like:

Sub DeleteTitles()
Dim oSl As Slide
Dim oSh As Shape
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
If oSh.Type = msoPlaceholder Then
If oSh.PlaceholderFormat.Type = ppPlaceholderTitle Then
oSh.Delete
oSl.Layout = ppLayoutChart
End If
End If
Next
Next
End Sub
 
S

sylvainpellletier

Thanks Steve ! It works just fine.
I have just deleted that part : oSl.Layout = ppLayoutChart
It wasn't useful in my case.

Thanks again !
 

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