Solved

PowerPoint Macro Change Custom Layout

Posted on 2008-10-07
6
2,386 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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: …

631 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