Re: Detecting whether a toolbar is and should be shown

Status
Not open for further replies.
Q

QnJ1bndpbg

Thanks. There was an additional trick to it as follows. By using the

visible property from the most recently opened (still open) window's toolbar

and saving the visible property when a toolbar closes to use when no already

open window exists the standard Outlook toolbar behaviour can be replicated.

Thanks,

Nick
wrote:


> When the window is closed, either Inspector or Explorer, check your
> toolbar's Visible and Enabled properties and persist that information
> somewhere. Use that the next time.

> >

>

> "Brunwin" <Brunwin> wrote in message
> news:0D8930D8-0D79-478C-901A-FB0644902719@microsoft.com...
> >I have two toolbars I've implemented in Outlook using VSTO 2005 SE - one
> > inspector commandbar and one explorer commandbar. At the moment they both
> > launch when the relevant window is launched and add themselves to the
> > commandbars list.
> > The flaw with this is that when the user right clicks on the toolbar area
> > and unticks my commandbar, hiding it, then shuts Outlook and reopens it my
> > commandbar naively reloads itself into the toolbar area. Really it should
> > wait until the user re-ticks it's name before it appears. To be able to
> > do
> > this I'd need to be able to either detect whether my commandbar is visible
> > or
> > detect when my commandbar is hidden and when it is made visible. I can't
> > seem to identify within the VSTO 2005 API a way to do this. I presume
> > though
> > that this is something that a commandbar should support so I expect I'm
> > just
> > not finding the right way to do it.
> > Does anyone know how I should be doing this and what properties/events I
> > need to use for it?
> > Thanks in advance


>
 
Ok. I think it's fairer to say this solution works on XP with Office 2003.

With Vista and Office 2003 the close event isn't fired on the inspector

window when the "Save and Close" button is pressed.

With Office 2007 there isn't the right click show/hide (tick/untick) toolbar

option with ribbons but instead an option to delete the custom toolbar. The

deleting of the custom toolbar I can't detect in the code so I can't record

it so that my toolbar launches hidden.

Does anyone know how to work around either of these problems?

Thanks,

Nick

"Brunwin" wrote:


> Thanks. There was an additional trick to it as follows. By using the
> visible property from the most recently opened (still open) window's toolbar
> and saving the visible property when a toolbar closes to use when no already
> open window exists the standard Outlook toolbar behaviour can be replicated.

> Thanks,
> Nick

> " - " wrote:
>
> > When the window is closed, either Inspector or Explorer, check your
> > toolbar's Visible and Enabled properties and persist that information
> > somewhere. Use that the next time.
> > > >

> >

> > "Brunwin" <Brunwin> wrote in message
> > news:0D8930D8-0D79-478C-901A-FB0644902719@microsoft.com...
> > >I have two toolbars I've implemented in Outlook using VSTO 2005 SE - one
> > > inspector commandbar and one explorer commandbar. At the moment they both
> > > launch when the relevant window is launched and add themselves to the
> > > commandbars list.
> > > The flaw with this is that when the user right clicks on the toolbar area
> > > and unticks my commandbar, hiding it, then shuts Outlook and reopens it my
> > > commandbar naively reloads itself into the toolbar area. Really it should
> > > wait until the user re-ticks it's name before it appears. To be able to
> > > do
> > > this I'd need to be able to either detect whether my commandbar is visible
> > > or
> > > detect when my commandbar is hidden and when it is made visible. I can't
> > > seem to identify within the VSTO 2005 API a way to do this. I presume
> > > though
> > > that this is something that a commandbar should support so I expect I'm
> > > just
> > > not finding the right way to do it.
> > > Does anyone know how I should be doing this and what properties/events I
> > > need to use for it?
> > > > Thanks in advance

> >
 
1. Handle the item.Close() event in addition to the Inspector.Close() event.

2. No event when a custom toolbar is deleted in Outlook 2007's ribbon, but

in Outlook 2007 you should be using the ribbon and not CommandBars in an

Inspector anyway. And if the toolbar is deleted then when you iterate the

CommandBars collection of the Inspector you won't find it there, so you can

assume it was deleted.

"Brunwin" <Brunwin> wrote in message

news:9CF16A13-05B2-475F-86F4-EB2FEA8CC130@microsoft.com...
> Ok. I think it's fairer to say this solution works on XP with Office
> 2003.

> With Vista and Office 2003 the close event isn't fired on the inspector
> window when the "Save and Close" button is pressed.
> With Office 2007 there isn't the right click show/hide (tick/untick)
> toolbar
> option with ribbons but instead an option to delete the custom toolbar.
> The
> deleting of the custom toolbar I can't detect in the code so I can't
> record
> it so that my toolbar launches hidden.

> Does anyone know how to work around either of these problems?

> Thanks,
> Nick
 
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.
wrote:


> 1. Handle the item.Close() event in addition to the Inspector.Close() event.

> 2. No event when a custom toolbar is deleted in Outlook 2007's ribbon, but
> in Outlook 2007 you should be using the ribbon and not CommandBars in an
> Inspector anyway. And if the toolbar is deleted then when you iterate the
> CommandBars collection of the Inspector you won't find it there, so you can
> assume it was deleted.

> >

>

> "Brunwin" <Brunwin> wrote in message
> news:9CF16A13-05B2-475F-86F4-EB2FEA8CC130@microsoft.com...
> > Ok. I think it's fairer to say this solution works on XP with Office
> > 2003.
> > With Vista and Office 2003 the close event isn't fired on the inspector
> > window when the "Save and Close" button is pressed.
> > With Office 2007 there isn't the right click show/hide (tick/untick)
> > toolbar
> > option with ribbons but instead an option to delete the custom toolbar.
> > The
> > deleting of the custom toolbar I can't detect in the code so I can't
> > record
> > it so that my toolbar launches hidden.
> > Does anyone know how to work around either of these problems?
> > Thanks,
> > Nick


>
 
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.
wrote:


> 1. Handle the item.Close() event in addition to the Inspector.Close() event.

> 2. No event when a custom toolbar is deleted in Outlook 2007's ribbon, but
> in Outlook 2007 you should be using the ribbon and not CommandBars in an
> Inspector anyway. And if the toolbar is deleted then when you iterate the
> CommandBars collection of the Inspector you won't find it there, so you can
> assume it was deleted.

> >

>

> "Brunwin" <Brunwin> wrote in message
> news:9CF16A13-05B2-475F-86F4-EB2FEA8CC130@microsoft.com...
> > Ok. I think it's fairer to say this solution works on XP with Office
> > 2003.
> > With Vista and Office 2003 the close event isn't fired on the inspector
> > window when the "Save and Close" button is pressed.
> > With Office 2007 there isn't the right click show/hide (tick/untick)
> > toolbar
> > option with ribbons but instead an option to delete the custom toolbar.
> > The
> > deleting of the custom toolbar I can't detect in the code so I can't
> > record
> > it so that my toolbar launches hidden.
> > Does anyone know how to work around either of these problems?
> > Thanks,
> > Nick


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

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.

"Brunwin" <Brunwin> wrote in message

news:F1683608-878C-40CA-BA9D-51E08B5E7207@microsoft.com...
> 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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
R Detecting if attachement is embedded or not Outlook VBA and Custom Forms 1
E Issue with detecting changes in a folder. Outlook 2003. Outlook VBA and Custom Forms 3
L However, before you place an order, you want to pick out whether or not you want the to Using Outlook 0
glnz O365 - How to control whether my From name shows as "Dicky". Using Outlook 2
oliv- How to distinguish whether mail is incoming or outgoing? Outlook VBA and Custom Forms 2
M Auto-reply with macro whether logged in to outlook or not Outlook VBA and Custom Forms 2
D Check whether mail item is proper for sending or not Outlook VBA and Custom Forms 5
H out to check whether outlook configured or not Outlook VBA and Custom Forms 1
A Quick Access Toolbar Not Showing Description Using Outlook 0
V How to add 'Previous Item' and 'Next Item' to the Quick Access Toolbar Using Outlook 1
J Text icon in Quick Access toolbar ? Using Outlook 2
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
O Outlook 365 - Toolbar - Close all items - missing? Using Outlook 3
O Windows 1803 update : QAT and toolbar changed, language pack gone... Using Outlook 5
R Categorize Button in Quick Access Toolbar Disappears on New Email Using Outlook 1
F want inbox on toolbar to reference icloud messages Using Outlook 2
Diane Poremsky Synchronize Quick Access Toolbar and Ribbons? Using Outlook 0
soadfan Enable all rules from toolbar button? Outlook VBA and Custom Forms 3
J Adding Reply & Delete to main toolbar? Using Outlook 0
Diane Poremsky Customize the Outlook Toolbar, Ribbon or QAT Using Outlook 0
L Outlook 2007 Custom Form and Toolbar Not Working Using Outlook 5
E Outlook 2007: Problem with "Move to Folder >" button on toolbar Using Outlook 6
B Outlook 2007 Save Current View,Font,Toolbar Settings Using Outlook 6
L Outlook 2007 Toolbar Export and Import Using Outlook 7
V Avast! Antispam toolbar Using Outlook 11
B Trouble Locating Tools Menu since There's No Standard Toolbar in Office 2010 Using Outlook 1
N Combobox in outlook add ons toolbar not firing event on main window resized Using Outlook 3
B Outlook Toolbar disabled Using Outlook 1
P Can't add a custom hyperlink to toolbar in OL 2010 Using Outlook 1
E Blank Print Preview when access via the Quick Access toolbar Using Outlook 3
Commodore Back/Forward toolbar buttons with pull-down history? Using Outlook 5
D How can I add a user created template to the toolbar Outlook VBA and Custom Forms 1
D How do I run a rule by using a toolbar icon? Outlook VBA and Custom Forms 4
S How to Create Buttons in email body / toolbar Outlook VBA and Custom Forms 3
P Problem in temporary type toolbar Outlook VBA and Custom Forms 1
P Problem in permanent type add-in toolbar Outlook VBA and Custom Forms 6
P Create TextBox in Outlook toolbar Outlook VBA and Custom Forms 1
T Quick Access Toolbar Using Outlook 3
S inspector toolbar buttons get multiple events Outlook VBA and Custom Forms 3
S toolbar visible state change event Outlook VBA and Custom Forms 1
S show icon while toolbar button is disabled. Outlook VBA and Custom Forms 1
S Quick access toolbar in inspector window Outlook VBA and Custom Forms 3
S Persist toolbar visible state Outlook VBA and Custom Forms 5
J Excel 2002 Forms toolbar Outlook VBA and Custom Forms 1
R How to implement customize toolbar in outlook? Outlook VBA and Custom Forms 1
J Toolbar button to process current mailitem Outlook VBA and Custom Forms 1
C Re: Hide BCM toolbar BCM (Business Contact Manager) 1
T Creating toolbar in new Explorer Outlook VBA and Custom Forms 3
R How to add toolbar to MailEditor for outlook? Outlook VBA and Custom Forms 14
H Add an item to the "new" - option in outlook toolbar Outlook VBA and Custom Forms 6

Similar threads

Back
Top