Strange behaviour of toolbars 
Author Message
 Strange behaviour of toolbars

Hi.

I've written some Outlook VBA code that puts toolbars on both the main
Outlook window, and on the standard mail form. It does this by adding
CommandBar objects to both
ThisOutlookSession.Application.ActiveExplorer.CommandBars and a new mail
item, thus:

Set MyItem = ThisOutlookSession.Application.CreateItem(olMailItem)
Set MyInspector = MyItem.GetInspector

MyInspector.CommandBars.Add(...)

This seems to work fine, but the toolbar contains a combo box, whose list
items must be updated fairly regularly. Updating the main window toolbar
works fine by just getting a reference to the combo control and manipulating
it, but I dont seem to be able to reliably get the combo on the form's
toolbar to update.

I've tried:

1. Creating a new item (as above), and manipulating that;
2. looping through all inspectors in Outlook.Application.Inspectors, and
changing them all;
3. doing above, but deleting and re-creating the toolbar rather than just
changing the control.

All of these result in the combos not being updated in either the toolbars
on the "New mail" form, or the "Existing mail" form (are these the same?),
or both.

Note that exiting / re-starting Outlook updates all OK (via code in
Application_Startup)

Is there a way to do this?

Thanks for any help,

ROSCO



Sun, 13 Apr 2003 09:48:46 GMT  
 Strange behaviour of toolbars
Yeah, I know it's bad karma to reply to my own post, but..

I think I've solved the problem by implementing a NewInspector event, but
I'm still curious why it behaves so strangely....

ROSCO


Quote:
> Hi.

> I've written some Outlook VBA code that puts toolbars on both the main
> Outlook window, and on the standard mail form. It does this by adding
> CommandBar objects to both
> ThisOutlookSession.Application.ActiveExplorer.CommandBars and a new mail
> item, thus:

> Set MyItem = ThisOutlookSession.Application.CreateItem(olMailItem)
> Set MyInspector = MyItem.GetInspector

> MyInspector.CommandBars.Add(...)

> This seems to work fine, but the toolbar contains a combo box, whose list
> items must be updated fairly regularly. Updating the main window toolbar
> works fine by just getting a reference to the combo control and
manipulating
> it, but I dont seem to be able to reliably get the combo on the form's
> toolbar to update.

> I've tried:

> 1. Creating a new item (as above), and manipulating that;
> 2. looping through all inspectors in Outlook.Application.Inspectors, and
> changing them all;
> 3. doing above, but deleting and re-creating the toolbar rather than just
> changing the control.

> All of these result in the combos not being updated in either the toolbars
> on the "New mail" form, or the "Existing mail" form (are these the same?),
> or both.

> Note that exiting / re-starting Outlook updates all OK (via code in
> Application_Startup)

> Is there a way to do this?

> Thanks for any help,

> ROSCO



Sun, 13 Apr 2003 14:47:12 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. strange behaviour of a subform, or a bug?

2. Strange Access behaviour or Bug, or what ?!?

3. Strange Behaviour

4. XP users - Strange date behaviour

5. Strange behaviour in Word

6. DT Picker Control on Multi Page - Strange Behaviour

7. Public folders strange behaviour ?

8. strange text file behaviour

9. Strange debugging behaviour

10. decimal point - strange behaviour macro Word 97 and previous vers ion

11. Strange Behaviour on MultiPage

12. Strange behaviour of AfterUpdate event

 

 
Powered by phpBB® Forum Software