Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 836
  • Last Modified:

Show a CustomLayout on PowerPoint 2007/10 using VBA

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
momsoft2
Asked:
momsoft2
1 Solution
 
JSRWilsonCommented:
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
 
momsoft2Author Commented:
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Tackle projects and never again get stuck behind a technical roadblock.
Join Now