initiate PP instance in slidesorter view on A200 forms

S

Silvester

Hi,

I'd like to know if it is possible to initiate a menuless instance of
Powerpoint in slidesorter view on a A2000 form ?

If so, how ?

I would like to be able to sort/reorder/project my vba automation-generated
slideshow right on my A2000 form.

Appreciate if I could be pointed in the right direction.
 
S

Silvester

Very well actually - the dsoFramer is a revelation but not much
documentation is available. It works great but any ideas on how to get the
ppt to start in slidesorter view ?
 
S

Stephen Lebans

Once you load in the PP document you have access to PP via the
Automation object.
Here's some sample code to do what you want.


Add a reference to the PP Object library for whatever version of
PowerPoint is on your system.
Place a DSOFramer control on a Form. Name the control ctlDSO.
Add a CommandButton and place the indicated code behind it.

Option Compare Database

Dim dso As DSOFramer.FramerControl

Dim pp As PowerPoint.Presentation

Private Sub cmdSlide_Click()
On Error GoTo Err_cmdSlide_Click

Set pp = dso.ActiveDocument
pp.Windows(1).ViewType = ppViewSlideSorter
Exit_cmdSlide_Click:
Exit Sub

Err_cmdSlide_Click:
MsgBox Err.Description
Resume Exit_cmdSlide_Click

End Sub

Private Sub Form_Load()
Set dso = Me.ctlDSO.Object

End Sub

Private Sub Form_Unload(Cancel As Integer)
Set dso = Nothing

End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Silvester said:
Very well actually - the dsoFramer is a revelation but not much
documentation is available. It works great but any ideas on how to get the
ppt to start in slidesorter view ?
 
S

Silvester

Outstanding, Stephen - thank you.

How can I hide the standard PP views toolbar at the bottom of the dso
screen, ie: Normal, Outline, Slide, Slide Sorter, Slide Show views.

How can I trap user events on the dso control ? Basically I'd like to
disable normal PP behaviour on the dso.

- When user clicks on a slide in the slide sorter I'd like to have a msgbox
like "You clicked on slide number" & slideno

- When user double clicks the dso, default PP behaviour is to open the
selected slide in Normal view. I'd like to trap the dblclick event as well.

Here's the slightly amended code I am using on my A2000 form.

'========================
' Code start
'========================
Option Compare Database
Option Explicit

Dim dso As DSOFramer.FramerControl
Dim pp As PowerPoint.Presentation


Private Sub Form_Activate()
Dim strPath As String
On Error GoTo HandleErr

dso.MenuBar = False
strPath = CurrentProject.Path & "\mypres.ppt"
dso_Open strPath, True, "Powerpoint.Show"

Set pp = dso.ActiveDocument
pp.Windows(1).ViewType = ppViewSlideSorter

HandleErr:
MsgBox Err.Description
Resume ExitHere

ExitHere:
Exit Sub

End Sub

Private Sub Form_Load()
Set dso = Me.ctlDso_Object
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set dso = Nothing
End Sub






Stephen Lebans said:
Once you load in the PP document you have access to PP via the
Automation object.
Here's some sample code to do what you want.


Add a reference to the PP Object library for whatever version of
PowerPoint is on your system.
Place a DSOFramer control on a Form. Name the control ctlDSO.
Add a CommandButton and place the indicated code behind it.

Option Compare Database

Dim dso As DSOFramer.FramerControl

Dim pp As PowerPoint.Presentation

Private Sub cmdSlide_Click()
On Error GoTo Err_cmdSlide_Click

Set pp = dso.ActiveDocument
pp.Windows(1).ViewType = ppViewSlideSorter
Exit_cmdSlide_Click:
Exit Sub

Err_cmdSlide_Click:
MsgBox Err.Description
Resume Exit_cmdSlide_Click

End Sub

Private Sub Form_Load()
Set dso = Me.ctlDSO.Object

End Sub

Private Sub Form_Unload(Cancel As Integer)
Set dso = Nothing

End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Stephen Lebans

Those are standard Automation questions which would best be asked in a
PowerPoint NG.

You would not be trapping event sof the DSO control rather of the PP
aplication itself.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Silvester

Thanks again for all the help

Stephen Lebans said:
Those are standard Automation questions which would best be asked in a
PowerPoint NG.

You would not be trapping event sof the DSO control rather of the PP
aplication itself.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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