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 / June 2006

Tip: Looking for answers? Try searching our database.

Enable/Disable Add-in

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Trevor Williams - 26 Jun 2006 12:41 GMT
Hi All

I've created an add-in for ppt 2002

I'd like to enable / disable it depending on whether a presentation is open
or not.  Is there an easy way to do this?

Thanks

Trevor
Steve Rindsberg - 26 Jun 2006 16:02 GMT
> Hi All
>
> I've created an add-in for ppt 2002
>
> I'd like to enable / disable it depending on whether a presentation is open
> or not.  Is there an easy way to do this?

Simplest is to have your code do something like:

If Windows.Count = 0 Then
  ' No presentations
  ' Optionally ...
  MsgBox ("Open a presentation then try again, please.")
  Exit Sub
End if

' remainder of your code follows ...

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
Trevor Williams - 26 Jun 2006 16:19 GMT
Thanks Steve - that'll do it.

Out of curiosity, do you know if the menu item for the Add-in can be grayed
out (therefoere not useable) until a presentation is open?

Thanks again

Trevor

> > Hi All
> >
[quoted text clipped - 19 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 26 Jun 2006 19:55 GMT
> Thanks Steve - that'll do it.
>
> Out of curiosity, do you know if the menu item for the Add-in can be grayed
> out (therefoere not useable) until a presentation is open?

If you implement an event handler, it should be, yes.

Make PPT respond to events
http://www.rdpslides.com/pptfaq/FAQ00004.htm

Off top of head, you'd want to trap the PresentationClose event and disable the
menu if there are no presentations active; and trap the New Presentation and
PresentationOpen events to enable the menu.

It might be enough just to work with the WindowActivate event; enable the menu if
there's a presentation active and disable it if not.

> Thanks again
>
[quoted text clipped - 23 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
Trevor Williams - 27 Jun 2006 09:41 GMT
Splendid, I'll give it a go.

Thanks again

> > Thanks Steve - that'll do it.
> >
[quoted text clipped - 46 lines]
> PPTools:  www.pptools.com
> ================================================
 
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.