G
Gervase Markham
No, I'm not asking for the impossible - I know PowerPoint 97 doesn't
support events . What I'm looking for is a way of making an add-in
that supports events in 2000 while still working (without the events) in 97.
Having followed Shyam's excellent tutorial:
http://www.rdpslides.com/pptfaq/FAQ00004.htm
I now have a class module called UIState, which begins:
Public WithEvents PPTEvent As Application
In Auto_Open(), I do:
Dim UIStateObserver As New UIState
Set UIStateObserver.PPTEvent = Application
....and so on.
However, the PPT97 Visual Basic compiler doesn't like the WithEvents
keyword there - I get:
"Object does not source automation events".
Fair enough, I think - I need to have one variable without WithEvents
for 97, and one with it for 2000. Obvious try:
If Application.Version > 8 Then
Public WithEvents PPTEvent as Application
Else
Public PPTEvent As Application
End If
Of course, this doesn't work; the If statement is flagged with:
"Invalid outside procedure"
So, the question:
Is there any way of inserting a code fork such that PowerPoint 2000 and
above see the WithEvents version, and 97 the plain version? Or some
other method or way of arranging the code to get them to peacefully coexist?
If not, my only options are
a) two downloads, or
b) abandon the events.
Both these options suck. :-(
Many thanks,
Gerv
support events . What I'm looking for is a way of making an add-in
that supports events in 2000 while still working (without the events) in 97.
Having followed Shyam's excellent tutorial:
http://www.rdpslides.com/pptfaq/FAQ00004.htm
I now have a class module called UIState, which begins:
Public WithEvents PPTEvent As Application
In Auto_Open(), I do:
Dim UIStateObserver As New UIState
Set UIStateObserver.PPTEvent = Application
....and so on.
However, the PPT97 Visual Basic compiler doesn't like the WithEvents
keyword there - I get:
"Object does not source automation events".
Fair enough, I think - I need to have one variable without WithEvents
for 97, and one with it for 2000. Obvious try:
If Application.Version > 8 Then
Public WithEvents PPTEvent as Application
Else
Public PPTEvent As Application
End If
Of course, this doesn't work; the If statement is flagged with:
"Invalid outside procedure"
So, the question:
Is there any way of inserting a code fork such that PowerPoint 2000 and
above see the WithEvents version, and 97 the plain version? Or some
other method or way of arranging the code to get them to peacefully coexist?
If not, my only options are
a) two downloads, or
b) abandon the events.
Both these options suck. :-(
Many thanks,
Gerv