Solved

PowerPoint Macro Change Custom Layout

Posted on 2008-10-07
6
2,185 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
ID: 22661565
0
 

Author Comment

by:EAI_Chief
ID: 22662475
I need to reference the Custom Name for the Custom Layout
0
 
LVL 21

Expert Comment

by:GlennaShaw
ID: 22662760
http://msdn.microsoft.com/en-us/library/bb231180.aspx

Should return your customlayout name
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 21

Assisted Solution

by:GlennaShaw
GlennaShaw earned 100 total points
ID: 22662788
0
 

Accepted Solution

by:
EAI_Chief earned 0 total points
ID: 22757552
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
ID: 22757876
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outline From PowerPoint 2010 it is possible to have shapes appear in front of video, in earlier versions video always played in front of other shapes. This means it is possible to have captions animated to appear in front of video. Users who h…
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.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

776 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