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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Setting a default value for a RibbonX ComboBox item



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 28th 07, 01:26 AM posted to microsoft.public.outlook.program_addins
Rajesh K
external usenet poster
 
Posts: 11
Default Setting a default value for a RibbonX ComboBox item

I was wondering how the default value of an item in a combBox is set in the
RibbonX world. This used to be ListIndex in the older CommandBar model and I
used to set it to 1 (for example) after doing AddItems.

I used OutlookRibbonXVB_VSTO as a starting point and have the following XML
for the ribbon:
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="Ribbon_OnLoad"
ribbon
tabs
tab idMso="TabNewMailMessage"
group id="MyWidgetsGroup"
getVisible="MyWidgetsGroup_GetVisible"
getLabel="MyWidgetsGroup_GetLabel"
insertBeforeMso="GroupClipboard"

comboBox
id="MyCombo"
label="My Combo"
onChange ="MyCombo_OnChange"
getItemCount ="MyCombo_GetItemCount"
getItemLabel ="MyCombo_GetItemLabel"

/
{etc. for brevity}

The MyCombo_GetItemCount returns 4 and MyCombo_GetItemLabel returns the
strings
"A", "B", "C", and "D" for index values of 0, 1, 2,and 3 respectively.

When I display the new inspector, all the items are there when I pull down
the comboBox but the initial value is blank.

I am missing some connection somewhere between the object model and the XML
and can't seem to figure out the connection. Or there is a simple callback
somewhere I am missing.

Hope someone can help.
Ads
  #2  
Old July 30th 07, 09:29 PM posted to microsoft.public.outlook.program_addins
Patrick Schmid [MVP]
external usenet poster
 
Posts: 173
Default Setting a default value for a RibbonX ComboBox item

Let me start off with something else: If you want to limit your users to
choices only in the list, then use a dropDown, not a comboBox. For the
dropDown, I think it is getSelectedItemID or getSelectedItemIndex.
The comboBox has a getText callback. Use that callback to return the
string that you want it to show.


Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




"Rajesh K" wrote in message
:

I was wondering how the default value of an item in a combBox is set in the
RibbonX world. This used to be ListIndex in the older CommandBar model and I
used to set it to 1 (for example) after doing AddItems.

I used OutlookRibbonXVB_VSTO as a starting point and have the following XML
for the ribbon:
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="Ribbon_OnLoad"
ribbon
tabs
tab idMso="TabNewMailMessage"
group id="MyWidgetsGroup"
getVisible="MyWidgetsGroup_GetVisible"
getLabel="MyWidgetsGroup_GetLabel"
insertBeforeMso="GroupClipboard"

comboBox
id="MyCombo"
label="My Combo"
onChange ="MyCombo_OnChange"
getItemCount ="MyCombo_GetItemCount"
getItemLabel ="MyCombo_GetItemLabel"

/
{etc. for brevity}

The MyCombo_GetItemCount returns 4 and MyCombo_GetItemLabel returns the
strings
"A", "B", "C", and "D" for index values of 0, 1, 2,and 3 respectively.

When I display the new inspector, all the items are there when I pull down
the comboBox but the initial value is blank.

I am missing some connection somewhere between the object model and the XML
and can't seem to figure out the connection. Or there is a simple callback
somewhere I am missing.

Hope someone can help.


  #3  
Old July 31st 07, 06:36 AM posted to microsoft.public.outlook.program_addins
Rajesh K
external usenet poster
 
Posts: 11
Default Setting a default value for a RibbonX ComboBox item

Works. Thank you. Thanks for also providing the dropDown information. I
could never have guessed the functionality based on their names or their
documentation. It is clear now.

-- R

"Patrick Schmid [MVP]" wrote:

Let me start off with something else: If you want to limit your users to
choices only in the list, then use a dropDown, not a comboBox. For the
dropDown, I think it is getSelectedItemID or getSelectedItemIndex.
The comboBox has a getText callback. Use that callback to return the
string that you want it to show.


Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed




"Rajesh K" wrote in message
:

I was wondering how the default value of an item in a combBox is set in the
RibbonX world. This used to be ListIndex in the older CommandBar model and I
used to set it to 1 (for example) after doing AddItems.

I used OutlookRibbonXVB_VSTO as a starting point and have the following XML
for the ribbon:
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="Ribbon_OnLoad"
ribbon
tabs
tab idMso="TabNewMailMessage"
group id="MyWidgetsGroup"
getVisible="MyWidgetsGroup_GetVisible"
getLabel="MyWidgetsGroup_GetLabel"
insertBeforeMso="GroupClipboard"

comboBox
id="MyCombo"
label="My Combo"
onChange ="MyCombo_OnChange"
getItemCount ="MyCombo_GetItemCount"
getItemLabel ="MyCombo_GetItemLabel"

/
{etc. for brevity}

The MyCombo_GetItemCount returns 4 and MyCombo_GetItemLabel returns the
strings
"A", "B", "C", and "D" for index values of 0, 1, 2,and 3 respectively.

When I display the new inspector, all the items are there when I pull down
the comboBox but the initial value is blank.

I am missing some connection somewhere between the object model and the XML
and can't seem to figure out the connection. Or there is a simple callback
somewhere I am missing.

Hope someone can help.



 




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
ribbonx and with c++ Daniel Add-ins for Outlook 2 February 23rd 07 02:11 PM
Combobox in user defined appointment item Lucia Outlook and VBA 3 September 21st 06 07:49 PM
Problem with setting Outlook item userproperties KeithXP Outlook and VBA 4 April 14th 06 02:01 PM
Is there a policy or registry setting for setting the default addr scsi Outlook - Installation 1 February 28th 06 01:19 PM
setting default for combobox... Jim Burke in Novi Outlook and VBA 1 January 30th 06 07:26 PM


All times are GMT +1. The time now is 09:22 AM.


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.