WordMail is weird and wonderful and a royal PITA.
For use with WordMail I iterate the CommandBars collection looking for my
CommandBar and then re-instantiating the button object to be able to change
State. Your existing button object will fire Click() for example but even in
that event handler trying to change State will fire an exception. You must
re-instantiate the button from the object retrieved from Word.Document and
then you can change State.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Darshan" darshan.tilak@gmail wrote in message
...
Thanks Ken. It did work. I got the button, and its status, correctly, but
there is still a small problem.
I got the code working to fetch the button status, but it does not work if
Outlook is using Microsoft Word to compose its emails. If Word is being
used, then it is just not possible to get to the button programatically.
I found the same problem being encountered by other people on
Outlookcode.com. And there seems to be no solution for it. Please share
with me if you are aware of any solution for this.
Thanks anyway,
Darshan