Solved

PowerPoint Macro Change Custom Layout

Posted on 2008-10-07
6
2,113 Views
Last Modified: 2013-11-27
I need to be able to find the Layout Name in PowerPoint so I can reference it in a VB Script.

I will be using the following code:
ActiveWindow.Selection.SlideRange.Layout = ppLayout"LAYOUT NAME"

I have built custom layouts in PowerPoint 2007 based upon the original layouts.  For example I took the 'Blank' Template and renamed it 'Navigation' and changed the colors/fonts/etc.  

When I try to change the layout of the current slide to the new Navigation layout with the following code I get a debug error (Slide Unknown: Invalid enumeration value)::
ActiveWindow.Selection.SlideRange.Layout = ppLayoutNavigation

When I enter the the following code, I am able to change my current slide layout to the new Navigation layout
ActiveWindow.Selection.SlideRange.Layout = ppLayoutBlank

It appears even though I have renamed the Blank Layout to Navigation it is still coded as Blank in order to reference it in script.  I have numerous slide layouts with new names, and I am not sure what the appropriate code name to use is.  

Does anyone know how to find out the name of the layout to use in the macro?  It is not as simple of checking the name of the slide layout in the Slide Master.
0
Comment
Question by:EAI_Chief
  • 4
  • 2
6 Comments
 
LVL 21

Expert Comment

by:GlennaShaw
Comment Utility
0
 

Author Comment

by:EAI_Chief
Comment Utility
I need to reference the Custom Name for the Custom Layout
0
 
LVL 21

Expert Comment

by:GlennaShaw
Comment Utility
http://msdn.microsoft.com/en-us/library/bb231180.aspx

Should return your customlayout name
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 21

Assisted Solution

by:GlennaShaw
GlennaShaw earned 100 total points
Comment Utility
0
 

Accepted Solution

by:
EAI_Chief earned 0 total points
Comment Utility
I was not able to successful call a specific custom layout, so I created a macro that would automatically add a text box that would cover the navigation i was trying to get rid of.
0
 
LVL 21

Expert Comment

by:GlennaShaw
Comment Utility
This didn't help?:
Working with Slides
A presentation contains one or more slides; these are represented as a Slides collection within each Presentation object.
Adding a slide takes a few lines of code, and you will need to work around some of the peculiarities of the Office PowerPoint automation model. To add a slide, you need to specify a custom layout. The custom layouts are stored in the presentation master and differ, depending on the presentation template. For expediency, we just choose the first custom layout in the master. After creating the slide by using the custom master, you can set the final intended layout by using the Slide.Layout method with any of the 37 slide layouts that are found in the PpSlideLayout enumeration:

Dim objSlide As PowerPoint.Slide
Dim objCustomLayout As PowerPoint.CustomLayout
objCustomLayout = objPres.SlideMaster.CustomLayouts.Item(1)
objSlide = objPres.Slides.AddSlide(1, objCustomLayout)
objSlide.Layout = PowerPoint.PpSlideLayout.ppLayoutTitleOnly
 
http://msdn.microsoft.com/en-us/library/bb251512.aspx
http://msdn.microsoft.com/en-us/library/bb251279.aspx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Setting the Scene Animations in PowerPoint are a great tool to convey messages when used carefuly with the content of your slides. There are plenty of animation effects and options, including a Repeat feature for individual animation effects. …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video teaches viewers how to add transitions to their Slideshows and how to set up timing for the transitions.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now