disable events in powerpoint

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.

I am developing a shared add-in that works for word, powerpoint, excel
and outlook. I am using c#

I need to disable all events for a short amount of time in my add-in.

In Excel I coud do this by using the application.enableEvent = false. I
then enabled the events again with application.enableEvent = true after
doing what I had to do without events. That worked perfectly!

I was so happy - moving on to make the same adjustments on the
powerpoint code... No - this function is not available for the
powerpoint object.

Do you know if I am wrong - maybe there is such a function for powerpoint?

Or, if I am right - do you know another way I could do this?
 
ok - I'm not sure I'm happy I was right....

But - maybe you coud give me some advise on how to disabe the event handler
"manually"?

Thanks for helping me:)
 
I'm not sure how you are setting up the event sink. But setting it to
nothing would prevent any events from being processed for the duration you
require and then reenable it by setting the reference to the application.


--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm
 
I'm setting up the event like this:

When I start the application the connect class starts. In the connect class
I add the presentationBeforeSave eventhandler like this:

((Microsoft.Office.Interop.PowerPoint.Application)applicationObject).PresentationBeforeSave
+= new
Microsoft.Office.Interop.PowerPoint.EApplication_PresentationBeforeSaveEventHandler( PowerPointSave );

When the user presses save I display a dialog box where he is given several
options. One of these options is to archive the ppt document in an external
archiving system. To do this I need to save the file temporarily. This is to
have a path to the document, so that I can send it to the archiving system.
This is where I need to disable the eventhandler.

When I try to save the ppt by using the presentation.saveas I get the saveas
dialog box... I don't want this to be displayed.

neoret
The PowerPointSave method is like this:
public void PowerPointSave( Microsoft.Office.Interop.PowerPoint.Presentation
Ppt, ref bool Cancel )
{
PptPresentationData pptPresentation = new
PptPresentationData(Ppt);

pptPresentation.PowerPointDocumentBeforeSave( Ppt, ref Cancel );
}
 
Dear mr Pillai.

I will be very happy if you could reply to my request written in my previous
post.

Please :)
 
Back
Top