VBA to add dropdown to Outlook Toolbar

bradyboyy88

Well-known Member
Joined
Feb 25, 2015
Messages
562
I have created a custom tab in outlook and now I want to add a textfield and dropdown box too it from an outlook vba module. Is this possible similar to excel's code to add commandbar items. For example, I have this code in excel:

Code:
    Set testbar= CommandBars.Add(Name:="stuff", Position:=msoBarTop, Temporary:=True, MenuBar:=False)
    testbar.Visible = True
    With testbar.Controls.Add(Type:=msoControlEdit)
      .Caption = "Caption"
      .Style = msoComboLabel
      .OnAction = "Test"
    End With
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try qualifying the reference to the Commandbars object with a reference to an Explorer object. For example, to refer to the active explorer...

Code:
    Set testbar = [COLOR=#ff0000]ActiveExplorer.[/COLOR]CommandBars.Add(Name:="stuff", Position:=msoBarTop, Temporary:=True, MenuBar:=False)

Hope this helps!
 
Upvote 0
That did the trick!! I made a custom tab named "TestTab" is there any change I can target that tab for where its located? I am also trying to make these input tools show on load of outlook and stay there permanantly. Currently it doesnt show when starting up so is there an outlook_open similar to excel I need to run this under or a better solution? And it only shows in the outlook toolbar but if I click an email and that opens in a seperate window and I hit reply, that toolbar seems to be missing this addin tab which the code currently seems to add this stuff too.

Sorry for the million questions but that really is the bulk of my project is learning these things because the technical aspects of using them I can figure out on my own.
 
Upvote 0
In Excel, it would involve the use of Ribbon XML code, which would be a bit more complex. In Outlook, however, I really don't know. Sorry I can't provide you with any further help.
 
Upvote 0

Forum statistics

Threads
1,215,483
Messages
6,125,065
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top