
Object reference to Powerpoint presentation
Hi,
I have an Office Addin app which uses a designer adin for Powerpoint. I have
declared
Public WithEvents gobjApp As PowerPoint.Application
Public WithEvents gobjDoc As PowerPoint.Presentation
and am using the open event.
Private Sub gobjApp_PresentationOpen(ByVal Pres As PowerPoint.Presentation)
Dim prop As DocumentProperty
Set gobjDoc = Pres
'Set Custom Document Properties
For Each prop In Doc.CustomDocumentProperties
If prop.Name = "Caller" Then
MsgBox prop.Name & "= <" & prop.Value & ">"
End If
Next
End Sub
However I am getting an error on the setting or indeed reference to the
'Pres' above ...the error reads...
"Error# 430 - Class does not support Automation or does not support expected
interface"
This happens even if I simply say "MsgBox Pres.Name". How am I to reference
the powerpoint presentation object ???
I use the same code in the other designers for Word, Excel etc and there is
no problem.
Has Powerpoint's object model (along with Publisher Visio and Project) been
implemented diferently to the other Office apps?...
Can anyone shed light on this or am I correct in assuming that it just wont
work!...
Regards
Jeff