Solved

Show a CustomLayout on PowerPoint 2007/10 using VBA

Posted on 2010-08-16
2
786 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
2 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 total points
Comment Utility
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
Comment Utility
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

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

Background   Certain code in VBA requires initialization, such as application events. The app initialization is often triggered by the Auto_Open sub which is a special procedure that runs when an add-in loads. More significantly, this sub does n…
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 transitions to their Slideshows and how to set up timing for the transitions.
The viewer will learn how to edit text. This includes Font, Spacing, Resizing, Color, and other special text options.

743 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

17 Experts available now in Live!

Get 1:1 Help Now