Assigning Master to Slide per VBA

M

MikeH

I am automating a complex presentation containing multiple masters.
As a reaction on a button click I create a new slide per VBA and now want to
assign the correct Master to it. How can I do this?

code snippet:
Set Sld = ActivePresentation.Slides.Add(pos, ppLayoutBlank)
' NOW I NEED TO ASSIGN THE CORRECT MASTER TO THE NEW SLIDE

If I assign the appropriate master design manually, the macro recorder isn't
really helpful, he always produces the line

ActivePresentation.ApplyTemplate FileName:=""

no matter what Design has been selected.

Thank you very much in advance for any answer. I really appreciate your
support.
/Mike
 
J

John Wilson

Hi Mike
You will need to use something like:
With ActivePresentation
..Slides(pos).Design = .Designs(2)
End With
-- This would apply the second design template, you can also rename the
masters and use eg =.Designs("johns")

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 

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