disable commandbarbutton

V

vj5

Hi experts

how to enable /disable commandbar button like:
when a application starts than if there is a document or excel sheet open
than commandBar button should be enable otherwise disable.
when user opens a document or excel sheet than the commandBar button
should be enable
How to do that?
 
C

Cindy M -WordMVP-

Hi Vj,
how to enable /disable commandbar button like:
when a application starts than if there is a document or excel sheet open
than commandBar button should be enable otherwise disable.
when user opens a document or excel sheet than the commandBar button
should be enable
Is this an Addin you've written? Using which programming language? Have you
any experience creating event handlers?

Based on what little information you give us, all one can say is: The Word
object model gives you a DocumentOpen event, and the Excel object model a
WorkbookOpen event. You need to hook into these and put the necessary code
in the event procedures.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
V

vj5

Hi Cindy
Thanks for replying.
Yes ,i written a add-in for ms office , which is having 2 commandBarButtons
in a menu.i created it successfully and its working fine .
my problem is that i wanted to disable the commandbarbutton when there is no
open document /excelshhet.
how i can use the DocumentOpen event in word and WorkbookOpen event in excel?
thanks again for helping me
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?dmo1?=,
i did it for word and excel but for powerpoint i am unable to find those
events.
For powerpoint, try asking in the one-and-only powerpoint newsgroup

news://msnews.microsoft.com/microsoft.public.powerpoint

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top