Re: Application Events in Powerpoint

Tech-Archive recommends: Fix windows errors by optimizing your registry



Here's some sample code. The first is a routine that executes to bring up a
dialog (as a MouseClick ActionEvent). It was intended to be complete,
loading/showing, then unloading when done. What would happen is that the
first time it ran, the dialog would show; the next time it wouldn't. (This
was not ALWAYS the case, but more often than not.) You'll note below that I
commented the unload instruction; this seemed to fix the situation. Which
means that it realistically could only load once reliably, then it got
confused. So what's posted below works, but would be cleaner with the unload
intact.

BTW, OffloadForm.Valid is simply a property I give to the UserForm to
indicate that the form contents when closed should be acted on.

Skip beyond this to see the Browse dialog code.

Public Sub DoOffload()

Load OffloadForm
OffloadForm.Show
If OffloadForm.Valid Then
If OffloadForm.AsynchOption Then
Application.ActivePresentation.Slides(3).Shapes("Group
98").Visible = msoTrue
Application.ActivePresentation.Slides(3).Shapes("Group
115").Visible = msoTrue
Else
Application.ActivePresentation.Slides(3).Shapes("Group
103").Visible = msoTrue
Application.ActivePresentation.Slides(3).Shapes("Group
127").Visible = msoTrue
End If
End If

'Unload OffloadForm
ClearMenuHighlights
HideMenu

End Sub

The Browse dialog issue is such that when the dialog runs, it comes up, but
pops PPT out of show mode.

Private Sub BrowseButton_Click()
Dim lDialog As FileDialog

Set lDialog = Application.FileDialog(msoFileDialogFilePicker)
If lDialog.Show = -1 Then Me.RTLFileBox = lDialog.SelectedItems(1)

Set lDialog = Nothing

End Sub


"Steve Rindsberg" wrote:

>
> > Presentation time is also not a robust environment; when I bring dialog
> > boxes up, sometimes they show up, sometimes not unless I restart PP. If you
> > show the File Browse dialog, it suddenly switches out of show mode to display
> > it, and when you close it you have to click back into show mode. Kinda breaks
> > the flow. I figure not many people try to do this since it seems so untested.
>
> Got some sample code you could post that demonstrates this?
> -----------------------------------------
> Steve Rindsberg, PPT MVP
> PPT FAQ: www.pptfaq.com
> PPTools: www.pptools.com
> ================================================
>
>
>
.


Quantcast