PowerPoint VBA Impossible Task!

L

Linda V

I need to be able to manipulate batches of PPT files so that the opening view
on all files is the same. I have written some VBA code that does everything,
except for one thing (and I'm beginning to think that this is impossible).
Here goes:

I set up the Presentation View to Normal View, so all 3 panes are showing.
In the Outline/Slide Pane (Pane 1), I need to be able to set the
Outline/Slides tabstrip to always be set on the "Slides" tab. If anyone
knows how to manipulate this, I would appreciate the help.

Currently, however the pane is set at the time of save is how it will show
up when the presentation view is switched to "Normal" view. I have already
tried to set me PPT Open options to "Normal - Thumbnail, Notes, Slide". This
does not work when opening files programmatically.

Below is a sample of the code:

Presentations.Open filename:="C:/test.ppt", ReadOnly:=msoFalse
ActiveWindow.ViewType = ppViewNormal

' This is the pane that needs to be set!
ActiveWindow.Panes(1).Activate

ActiveWindow.SplitHorizontal = 15
 
S

Shyam Pillai

Linda,
You cannot achieve it thru the object model since the viewtype property for
the panes is read-only but you can get around it using the following code:
Control ID 6015 toggles between thumbnails and outline view of the pane, It
appears in the Tools | Customize | Commands | Categories: View, Commands:
Show Outline.

' --------------------------------------------
ActiveWindow.ViewType = ppViewNormal
ActiveWindow.Panes(1).Activate
If ActiveWindow.Panes(1).ViewType = ppViewThumbnails Then
CommandBars.FindControl(Id:=6015).Execute
End If
' --------------------------------------------
 
M

Maverick Woo

Linda V said:
[...]
I set up the Presentation View to Normal View, so all 3 panes are showing.
In the Outline/Slide Pane (Pane 1), I need to be able to set the
Outline/Slides tabstrip to always be set on the "Slides" tab. If anyone
knows how to manipulate this, I would appreciate the help.
[...]

Try this instead:
Presentations.Open filename:="C:/test.ppt", ReadOnly:=msoFalse
ActiveWindow.ViewType = ppViewNormal
SendKeys "%3", 1 ' slide
' This is the pane that needs to be set!
ActiveWindow.Panes(1).Activate
ActiveWindow.SplitHorizontal = 15

The only "trick" is to know what the keys Alt-1,2,3,4 do. Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top