Solved

PowerPoint Macro Change Custom Layout

Posted on 2008-10-07
6
2,262 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google drive Permission Error 43 49
access vba query parametres from a repport 1 28
Access Query: Text to Date 10 32
Clear Current Value from Combobox 2 26
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

733 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