Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / July 2007

Tip: Looking for answers? Try searching our database.

PowerPoint Events in .net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ash - 14 Jul 2007 13:50 GMT
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
Austin Myers - 14 Jul 2007 16:49 GMT
ash,

With PPT you must build your own WithEvents class module.

Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com

> Hi, I am writing a .net application and need to hook up to PowerPoint
> events.
[quoted text clipped - 35 lines]
>
> Ashley
ash - 14 Jul 2007 17:48 GMT
Hi Austin,

I have written a class to open powerpoint and hook up to the events.  The
knowledge base articles for both vb and c# suggest using the approach I have
used below, and c# doesn't have a withevents keyword to my knowledge...can
you please clarify what you mean a little further.

Thanks,

Ashley

> ash,
>
[quoted text clipped - 45 lines]
> >
> > Ashley
Austin Myers - 14 Jul 2007 18:45 GMT
This is your lucky day!  Fellow MVP Shyam Pillai has done all the leg work
for your.  Go to: http://skp.mvps.org/vb/vbppt003.htm

Shyam not only explains it, he has all the code needed to fire PowerPoint
from an external application.  Of course you will need to make minor changes
to do it in .NET.

Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com

> Hi Austin,
>
[quoted text clipped - 58 lines]
>> >
>> > Ashley
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.