Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2013, 07:38 AM
tinfanide tinfanide is offline VBA: ppLayoutCustom Windows 7 64bit VBA: ppLayoutCustom Office 2010 32bit
Expert
VBA: ppLayoutCustom
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default VBA: ppLayoutCustom

Code:
ActivePresentation.Slides.Add 1, ppLayoutCustom
How about if I have two custom layouts?
It only adds the first custom layout.

Reply With Quote
  #2  
Old 03-14-2013, 07:56 AM
JohnWilson JohnWilson is offline VBA: ppLayoutCustom Windows 7 64bit VBA: ppLayoutCustom Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Slides.Add is legacy code from 2003. In 2010 you should use Slides.AddSlide

Sub MyLayout()
Dim ocust As CustomLayout
Set ocust = ActivePresentation.SlideMaster.CustomLayouts(2)' change number
ActivePresentation.Slides.AddSlide 1, ocust
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 03-16-2013, 04:23 AM
tinfanide tinfanide is offline VBA: ppLayoutCustom Windows 7 64bit VBA: ppLayoutCustom Office 2010 32bit
Expert
VBA: ppLayoutCustom
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by JohnWilson View Post
Slides.Add is legacy code from 2003. In 2010 you should use Slides.AddSlide

Sub MyLayout()
Dim ocust As CustomLayout
Set ocust = ActivePresentation.SlideMaster.CustomLayouts(2)' change number
ActivePresentation.Slides.AddSlide 1, ocust
End Sub
I got it. It should be somewhere in SlideMaster that is the answer to my doubt.
Many thanks.
Reply With Quote
Reply



Other Forums: Access Forums

All times are GMT -7. The time now is 11:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft