Outlook 2003: How do I create a Button which should work like New orSend/Receive in Standard Outlook

B

Baji

Hi Everybody,

Is there any way we can create CommandBarPopUp with Split DropDown in
Outlook 2003.

I want to have the similar functionality of "New" or "Send/Receive"
Button in my application?

How do I ? Can somebody help me out ?

Thanks
Baji.
 
K

Ken Slovak - [MVP - Outlook]

That's one of a number of controls that are only available internally to
Office apps and that aren't exposed to developers. You can simulate it with
other controls but the effect really isn't the same. Some extension
libraries such as AddIn Express say they can use controls from managed
Windows Forms but then you have to use managed code and you're tied in to
their development platform.
 
B

Baji

Hi Ken,

Thanks for your reply. I am becoming a big fan of you and this group
within a short span of time.. Its pleasant to get answers from you &
also your answers to several other questions. I really appreciate it.

But, I dont like this control here..How nice the contol is & it is bad
that I can't use it in my work :(

Can you suggest some ideas on the simulation.

Thanks,
Baji.


That's one of a number of controls that are only available internally to
Office apps and that aren't exposed to developers. You can simulate it with
other controls but the effect really isn't the same. Some extension
libraries such as AddIn Express say they can use controls from managed
Windows Forms but then you have to use managed code and you're tied in to
their development platform.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm




Hi Everybody,
Is there any way we can create CommandBarPopUp with Split DropDown in
Outlook 2003.
I want to have the similar functionality of "New" or "Send/Receive"
Button in my application?
How do I ? Can somebody help me out ?
Thanks
Baji.- Hide quoted text -

- Show quoted text -
 
K

Ken Slovak - [MVP - Outlook]

The usual hack is to place a combo control next to a button control, but of
course you can't really disguise the fact that there are 2 controls there
and not 1 integrated control.
 
B

Baji

Hi Ken,

I tried my ways of simulating the control & am not going good.

Can you please suggest me something deeper in the hack you have
advised earlier

"place a combo control next to a button control:

CommandBarButton is okay..I can create it.

How the other combo control should look like.. Usually combo box will
have a edit text & also a drop down right ? So, here what properties i
need to set for the combo control.Or, in other ways can you give me
the example of creating the combo control which will pop up a menu
underneath.

btnTest = (Office.CommandBarComboBox)commandBar.Controls.Add(
Office.MsoControlType.msoControlComboBox,
objMissing, objMissing, objMissing, objMissing);

where commandBar is my tool bar. I am using C# & coding for outlook
2003.

I am almost stuck with this, please help me out.

Thanks & Regards,
Baji.
 
K

Ken Slovak - [MVP - Outlook]

Pretty much no matter what you do the result is not going to look like the
New control. You can place a CommandBarButton on your CommandBar and then
next to it the CommandBarCombobox control.

The combo would have its items being the list you want to present and you
can set the combo to use one of the following types: msoControlEdit,
msoControlDropdown, msoControlComboBox, msoControlButtonDropdown,
msoControlSplitDropdown, msoControlOCXDropdown, msoControlGraphicCombo, or
msoControlGraphicDropdown.

Play with those types until you get the look you want. Then to add items to
the combo list use the AddItem method of the control.
 
B

Baji

Ken,

I tried all the options.
except fro the "msoControlEdit, msoControlDropdown,msoControlComboBox
", rest of the types am getting an exception. "Value doesn't fall in
the expected Range" etc.,
For above working three, I cant use because I am getting a white edit
box..which never matches my requirement.

What shall I do now ?.

Is there any way, I can create a menu & display it when a button is
pressed.

or can I use the "msoControlPopup" somehow ?

Thanks,
Baji.

Pretty much no matter what you do the result is not going to look like the
New control. You can place a CommandBarButton on your CommandBar and then
next to it the CommandBarCombobox control.

The combo would have its items being the list you want to present and you
can set the combo to use one of the following types: msoControlEdit,
msoControlDropdown, msoControlComboBox, msoControlButtonDropdown,
msoControlSplitDropdown, msoControlOCXDropdown, msoControlGraphicCombo, or
msoControlGraphicDropdown.

Play with those types until you get the look you want. Then to add items to
the combo list use the AddItem method of the control.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm


I tried my ways of simulating the control & am not going good.
Can you please suggest me something deeper in the hack you have
advised earlier
"place a combo control next to a button control:
CommandBarButton is okay..I can create it.
How the other combo control should look like.. Usually combo box will
have a edit text & also a drop down right ? So, here what properties i
need to set for the combo control.Or, in other ways can you give me
the example of creating the combo control which will pop up a menu
underneath.
btnTest = (Office.CommandBarComboBox)commandBar.Controls.Add(
Office.MsoControlType.msoControlComboBox,
objMissing, objMissing, objMissing, objMissing);
where commandBar is my tool bar. I am using C# & coding for outlook
2003.
I am almost stuck with this, please help me out.
Thanks & Regards,
Baji.
 
K

Ken Slovak - [MVP - Outlook]

A popup is only good for housing other controls that display when the popup
control is clicked. You certainly can display any type of form your language
supports when a button is clicked, just show the form in the Click event
handler.

If those other options aren't working then you need an alternate plan, there
isn't anything else available natively for controls in a CommandBar object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top