POwerpoint Layouts

J

James

I am using Powerpoint 2007. Because of the way we have the background
animated I have a presentatio with about 30 background of whic I use
abou 6 most of the time. I would like to make a vba form that would
stay on to choose those 6 when i need them The problem is that I do
not know how to determine the "names" of the slide layouts so that I
can assign them to the selected slide. Any sample VBA code would be
appreciated Thanks
 
J

James

I have made some headway with the follwoing code

For i = 1 To ActivePresentation.SlideMaster.CustomLayouts.Count
Debug.Print i & vbTab &
ActivePresentation.SlideMaster.CustomLayouts(i).Design.Name & vbTab &
ActivePresentation.SlideMaster.CustomLayouts(i).Name
Next i
i gives me the index number which I can then asign to a slide

osld.CustomLayout.Index = i

The prblem s that I have 5 dfferent slide master (allowed in Office
2007) and it only shows me the first one
 
J

James

I know I am replying to myself but someone else may be interested

Got help from this site

http://www.pptfaq.com/FAQ00902.htm

Rewrote code from here IT IS NOT REALLY MINE

Sub ListMasterNames()
Dim oPres As Presentation
Dim oSld As Slide
Dim oDes As Design
Dim sText As String
Dim FileNum As Integer
Dim PathSep As String
#If Mac Then
PathSep = ":"
#Else
PathSep = "\"
#End If
Set oPres = ActivePresentation
sText = "=== DESIGNS in this presentation ===" & vbCrLf
For Each oDes In oPres.Designs
sText = sText & oDes.Name & vbCrLf
Next
sText = sText & "=== List Of Styles ===" & vbCrLf
Dim x As Long
Dim y As Long
For x = 1 To ActivePresentation.Designs.Count
For y = 1 To
ActivePresentation.Designs(x).SlideMaster.CustomLayouts.Count
sText = sText & x & vbTab &
ActivePresentation.Designs(x).Name & vbTab & y & vbTab &
ActivePresentation.Designs(x).SlideMaster.CustomLayouts(y).Name &
vbCrLf
Next
Next
FileNum = FreeFile
Open oPres.Path & PathSep & "REPORT.TXT" For Output As FileNum
Print #FileNum, sText
Close FileNum

MsgBox "Your report is saved as:" & vbCrLf _
& oPres.Path & PathSep & "REPORT.TXT"

#If Mac Then
'MsgBox "Your report is saved as:" & vbCRLF _
& oPres.Path & PathSep & "REPORT.TXT"
#Else
Call Shell("Notepad.exe" & " " & oPres.Path & PathSep &
"REPORT.TXT", vbNormalFocus)
#End If

Set oPres = Nothing
End Sub
 

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