Forum Home
Press F1
 
Thread ID: 49673 2004-09-27 03:27:00 PowerpointXP and VBA sporvogn (6202) Press F1
Post ID Timestamp Content User
276021 2004-09-27 03:27:00 Hi - I am trying to intercept the filesave/ filesave as command but can not seem to do so. I want to be able to launch a userform beforehand, that takes user info and then use some of that data to construct filename. any ideas welcome sporvogn (6202)
276022 2004-09-27 04:20:00 Ive only got access to PPT97 at work which doesnt support events (how crap is that?) but these pages here may assist.

www.rdpslides.com

Also see the link to the event capture add-in which may help. I can see a Save event, but what you really need is a BeforeSave event. You might be able to motiro certain keystokes but dunno if this would work very well. Another alternative may be to disable the save/save as buttons but may not be a desirable route to take.

Why MS have such an inconsistent approach between apps in the Office Suite I dont know. Theres BeforeSave (and far more) available in Excel but events in Ppt, Word and Outlook are either non existent or poorly implemented. Good luck. :-)
parry (27)
276023 2004-09-27 04:28:00 Hi Parry,
Thanks for your reply.
I know where you are coming from but really it is not the event but the routine itself i want to replace as I cant pass info to the dialog box before it exits.
replacing the save routine allows me to construct as I like.
I know in word you just create a module with a subroutine called FileSave and/or FileSaveAs and tehse take preference to the inbuild routines.
Just can't find a way to do it in powerpoint - Grrrrrr.
sporvogn (6202)
276024 2004-09-27 05:09:00 Hi I think we are talking about the same thing. FileSave or FileSaveAs are effectively event procedures as they capture the action, and are procedure names which mean something to the application.

The trouble is finding what these are. The OnPresentationSave macro indicated in the link officeone.mvps.org may work for you if you have PPT 2000 or later.

hth
parry (27)
276025 2004-09-27 10:08:00 OK, Ive sussed this now. You will need PPT 2K or better or else your SOL.

1. Download & install the free AutoEvents Add-in (www.mvps.org)
2. Create a Class Module in VBA (Insert|Class Module) & insert the following code. Replace the name of your userform & add more code as required.
Option Explicit

Public WithEvents App As Application

Private Sub App_PresentationBeforeSave(ByVal Pres As Presentation, Cancel As Boolean)
'Show UserForm
UserForm1.Show

'Prevent the save action that's just occurred
Cancel = True

End Sub3. Insert a standard module (Insert|Module) and place the following code in it. Note that I renamed my Class Module to EventClassModule - select Class1 in project window(left window) and press F4 then rename it. If you decide not to rename it then substitute the name EventClassModule for Class1 (or whatever you named it) in the code below....
Option Explicit

Dim X As New EventClassModule
Sub InitializeApp()
Set X.App = Application
End Sub


Sub Auto_Open()
Call InitializeApp
End Sub
parry (27)
276026 2004-09-27 21:18:00 Parry,

What can I say - YOU ARE THE MAN !!!!!
Thank you for your assistance and the time taken in investigating for me.
Very much appreciated
sporvogn (6202)
276027 2004-09-28 01:14:00 Excellent, glad it worked for you. The investigation was worthwhile as I know how to handle events in PPT myself now. :D parry (27)
1