A
ash
Hi, I am writing a .net application and need to hook up to PowerPoint events.
I have been through the KB article but I cannot get it to catch any
PowerPoint eventd (I am using ppt 2003 and have tried both c# and vb
versions).
my code is here:
public MainForm()
{
ppt = new Microsoft.Office.Interop.PowerPoint.ApplicationClass();
ppt.Visible=Microsoft.Office.Core.MsoTriState.msoTrue;
System.Runtime.InteropServices.ComTypes.IConnectionPoint mConnectionPoint;
System.Runtime.InteropServices.ComTypes.IConnectionPointContainer cpContainer;
int mCookie;
cpContainer =
(System.Runtime.InteropServices.ComTypes.IConnectionPointContainer)ppt;
Guid guid = typeof( Microsoft.Office.Interop.PowerPoint.EApplication ).GUID;
cpContainer.FindConnectionPoint( ref guid, out mConnectionPoint );
mConnectionPoint.Advise( this, out mCookie );
}
[DispId(2006)]
public void
PresentationOpen(Microsoft.Office.Interop.PowerPoint.Presentation Pres)
{
System.Windows.Forms.MessageBox.Show("!");
}
I would be grateful for any help.
Thanks,
Ashley
I have been through the KB article but I cannot get it to catch any
PowerPoint eventd (I am using ppt 2003 and have tried both c# and vb
versions).
my code is here:
public MainForm()
{
ppt = new Microsoft.Office.Interop.PowerPoint.ApplicationClass();
ppt.Visible=Microsoft.Office.Core.MsoTriState.msoTrue;
System.Runtime.InteropServices.ComTypes.IConnectionPoint mConnectionPoint;
System.Runtime.InteropServices.ComTypes.IConnectionPointContainer cpContainer;
int mCookie;
cpContainer =
(System.Runtime.InteropServices.ComTypes.IConnectionPointContainer)ppt;
Guid guid = typeof( Microsoft.Office.Interop.PowerPoint.EApplication ).GUID;
cpContainer.FindConnectionPoint( ref guid, out mConnectionPoint );
mConnectionPoint.Advise( this, out mCookie );
}
[DispId(2006)]
public void
PresentationOpen(Microsoft.Office.Interop.PowerPoint.Presentation Pres)
{
System.Windows.Forms.MessageBox.Show("!");
}
I would be grateful for any help.
Thanks,
Ashley