From: Mike Williams on
With Powerpoint 2007, in 97-2003 compatibility mode:

I downloaded & installed the autoevents add-in by Shyam Pillai (http://
skp.mvps.org/autoevents.htm). Several of the included demo add-ins
fire properly (auto_open, auto_close). Auto_print, however, (the one
I need) doesn't. Any thoughts what I might be doing wrong? THANKS.
From: Shyam Pillai on
Mike,
I'll take a look at it later today. I haven't done an update for PPT 2007 so
I will what's up with it.

Regards,
Shyam Pillai


"Mike Williams" <mikewill44(a)gmail.com> wrote in message
news:6047b382-adb7-4371-ad9e-525db3c17b2d(a)i16g2000vbm.googlegroups.com...
> With Powerpoint 2007, in 97-2003 compatibility mode:
>
> I downloaded & installed the autoevents add-in by Shyam Pillai (http://
> skp.mvps.org/autoevents.htm). Several of the included demo add-ins
> fire properly (auto_open, auto_close). Auto_print, however, (the one
> I need) doesn't. Any thoughts what I might be doing wrong? THANKS.

From: Steve Rindsberg on
In article <6047b382-adb7-4371-ad9e-
525db3c17b2d(a)i16g2000vbm.googlegroups.com>, Mike Williams wrote:
> With Powerpoint 2007, in 97-2003 compatibility mode:
>
> I downloaded & installed the autoevents add-in by Shyam Pillai (http://
> skp.mvps.org/autoevents.htm). Several of the included demo add-ins
> fire properly (auto_open, auto_close). Auto_print, however, (the one
> I need) doesn't. Any thoughts what I might be doing wrong? THANKS.

I'd post the relevant code here as a start.


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


From: Mike Williams on
> I'd post the relevant code here as a start.
>

in module 1:
Option Explicit
' Sample demo of auto macros supported by the AutoEvents add-in for
PowerPoint 2000.
'[some procedures have been deleted]
'[the first two fire as expected]
Sub Auto_open()
MsgBox "You just opened the presentation."
End Sub

Sub Auto_Close()
MsgBox "You are closing the presentation."
End Sub

'[this one doesn't]
Sub Auto_Print()
MsgBox "You are about to print"
End Sub

in module 2:
Sub _
Auto_open()
Debug.Print " This is the second one"
End Sub

in Class Modules, clsCBEvents

Public WithEvents colCBars As Office.CommandBars
Public WithEvents CtrlHandler As Master

Private Sub colCBars_OnUpdate()
Static PreCopy As Integer
Dim MacroName As String
Dim PresName As String
Select Case PreCopy
Case Is > Presentations.Count
PreCopy = Presentations.Count
If PreCopy = 0 Then Exit Sub
Case Is < Presentations.Count
PreCopy = Presentations.Count
If PreCopy = 0 Then Exit Sub
If fnThisVBComponent(Presentations(PreCopy), "Auto_Open") <> ""
Then
MsgBox "You have a autoopen macro in ur document. Do you wish
to execute?", vbYesNo + vbQuestion, "Run Auto Open"
MacroName = Presentations(PreCopy).Name & "!" &
fnThisVBComponent(Presentations(PreCopy), "Auto_Open") & ".Auto_Open"
Application.Run MacroName
End If
Case Is = Presentations.Count
PreCopy = Presentations.Count
If PreCopy = 0 Then Exit Sub
If PreCopy = 1 Then
End If
End Select
End Sub

Function fnThisVBComponent(oBk As Presentation, sUniqueString As
String) As String
Dim oVBC As VBComponent
'Loop through the VBComponents in the given workbook's VBProject
For Each oVBC In oBk.VBProject.VBComponents
'Using it's code module
With oVBC.CodeModule
'See if we can find the unique string
If .Find(sUniqueString, 1, 1, .CountOfLines, 1000, True, True,
False) Then
'Found it, so return the VBComponent where it was found
Debug.Print oVBC.Name
If oVBC.Type = vbext_ct_StdModule Then
fnThisVBComponent = oVBC.Name
Exit For
End If
End If
End With
Next

End Function
From: John Wilson on
Works in 2007 here Mike

John

"Mike Williams" <mikewill44(a)gmail.com> wrote in message
news:839b80c5-eba3-486f-a494-7701c604dcdf(a)v12g2000vbg.googlegroups.com...
>> I'd post the relevant code here as a start.
>>
>
> in module 1:
> Option Explicit
> ' Sample demo of auto macros supported by the AutoEvents add-in for
> PowerPoint 2000.
> '[some procedures have been deleted]
> '[the first two fire as expected]
> Sub Auto_open()
> MsgBox "You just opened the presentation."
> End Sub
>
> Sub Auto_Close()
> MsgBox "You are closing the presentation."
> End Sub
>
> '[this one doesn't]
> Sub Auto_Print()
> MsgBox "You are about to print"
> End Sub
>
> in module 2:
> Sub _
> Auto_open()
> Debug.Print " This is the second one"
> End Sub
>
> in Class Modules, clsCBEvents
>
> Public WithEvents colCBars As Office.CommandBars
> Public WithEvents CtrlHandler As Master
>
> Private Sub colCBars_OnUpdate()
> Static PreCopy As Integer
> Dim MacroName As String
> Dim PresName As String
> Select Case PreCopy
> Case Is > Presentations.Count
> PreCopy = Presentations.Count
> If PreCopy = 0 Then Exit Sub
> Case Is < Presentations.Count
> PreCopy = Presentations.Count
> If PreCopy = 0 Then Exit Sub
> If fnThisVBComponent(Presentations(PreCopy), "Auto_Open") <> ""
> Then
> MsgBox "You have a autoopen macro in ur document. Do you wish
> to execute?", vbYesNo + vbQuestion, "Run Auto Open"
> MacroName = Presentations(PreCopy).Name & "!" &
> fnThisVBComponent(Presentations(PreCopy), "Auto_Open") & ".Auto_Open"
> Application.Run MacroName
> End If
> Case Is = Presentations.Count
> PreCopy = Presentations.Count
> If PreCopy = 0 Then Exit Sub
> If PreCopy = 1 Then
> End If
> End Select
> End Sub
>
> Function fnThisVBComponent(oBk As Presentation, sUniqueString As
> String) As String
> Dim oVBC As VBComponent
> 'Loop through the VBComponents in the given workbook's VBProject
> For Each oVBC In oBk.VBProject.VBComponents
> 'Using it's code module
> With oVBC.CodeModule
> 'See if we can find the unique string
> If .Find(sUniqueString, 1, 1, .CountOfLines, 1000, True, True,
> False) Then
> 'Found it, so return the VBComponent where it was found
> Debug.Print oVBC.Name
> If oVBC.Type = vbext_ct_StdModule Then
> fnThisVBComponent = oVBC.Name
> Exit For
> End If
> End If
> End With
> Next
>
> End Function
>
> __________ Information from ESET Smart Security, version of virus
> signature database 5002 (20100405) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>

__________ Information from ESET Smart Security, version of virus signature database 5002 (20100405) __________

The message was checked by ESET Smart Security.

http://www.eset.com