A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Detecting whether a toolbar is and should be shown



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old March 10th 09, 06:55 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Detecting whether a toolbar is and should be shown

VSTO or any other technology or language, Outlook 2003 or 2007:

Office.CommandBar bar = null;

int count = insp.CommandBars.Count;
for (int i = 1; i = count; i++)
{
bar = (Office.CommandBar)insp.CommandBars[i];
if (bar.Name == myBar.Name)
{
bool barVisible = bar.Visible;
}
}

Of course if you are developing for Outlook 2003 in VSTO the point is moot,
since that won't support the ribbon unless you use something like the
PIA-less methods mentioned by Andrew Whitechapel of the VSTO team on his
blog. But access to the CommandBars collections is not a reason to fork any
code.

--
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


"Brunwin" wrote in message
...
Thanks.

1 worked. I don't think in VSTO 2005 SE I can do 2 though. I think it
points towards having to split the codebase for Office 2003 and Office
2007
in the future though.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
detecting new mail in shared mailbox Mark VII Outlook and VBA 2 April 22nd 08 09:08 PM
Detecting the type of items for a folder dch3 Outlook and VBA 5 November 5th 07 05:11 PM
Detecting the .ActiveWindow() w/C# Vic[_2_] Outlook - General Queries 1 October 24th 07 07:21 PM
Detecting when Appointment Occurs mwernerps2 via OfficeKB.com Add-ins for Outlook 1 October 20th 07 11:29 PM
detecting when Word is being used to compose email ? Mark Beiley Add-ins for Outlook 5 July 23rd 07 06:35 AM


All times are GMT +1. The time now is 02:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.