Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Show a CustomLayout on PowerPoint 2007/10 using VBA

Posted on 2010-08-16
2
Medium Priority
?
816 Views
Last Modified: 2013-11-10
Hi,

My application uses several layouts. To make it easy for users to modify these layouts, I want to navigate to the correct layout used by the slide currently shown. On PowerPoint that would be clicking on View | Slide Master and then selecting the correct layout from the list on the slides panel.

My code would look something like:

' Get current slide layout used
Set myLayout = ActiveWindow.View.Slide.CustomLayout
' Show the slide master
ActiveWindow.ViewType = ppViewSlideMaster
' Select the layout
...

Open in new window


Apparently the View or Window object do not have a way to select a particular layout and assigning myLayout to ActiveWindow.View.Slide crashes PowerPoint (not surprising since it is expecting a slide, nor a layout). So, how do you do it.

Thank you ver much in advance.
0
Comment
Question by:momsoft2
[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
2 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 2000 total points
ID: 33445108
Not sure I understand, doesn't Powerpoint auto select the custom layout currently in use when you go to Master view?

You can click the button in code like his:

Application.CommandBars.ExecuteMso ("ViewSlideMasterView")
0
 

Author Comment

by:momsoft2
ID: 33452146
JSRWilson,

That was it. You are absolutely right. I wasn't aware of the ExecuteMso method. It is certainly a life saver.

Thank you very much.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Setting the Scene PowerPoint is a creative tool in the right hands but it also includes a much underutilised programming dimension. In this beginner level article, we're going to show you some of some key elements of programming PowerPoint using th…
This video teaches viewers how to add simple and professional themes to their slides.
The viewer will learn how to edit animations within the presentation, incorporate sound, and set everything up with timing.

721 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