ComboBox (using Commas)

S

srm

I'm using O2003, creating a custom form, using the combo box control.
I want to add multiple values but within those values I want to use
commas. For example

This is value number 1, and it has a comma
This is value number 2, and it has a comma

However, Outlook thinks the comma is a new entry and it lists the
items as follows:

This is value number 1
and it has a comma
This is value number 2
and it has a comma

It there a way to add entry using a comma as part of the entry?

Thank you.

Shawn
 
S

srm

You would need to use code in the form's Item_Open event handler. Seehttp://www.outlookcode.com/article.aspx?ID=32for a sample form.
--
Sue Mosher, Outlook MVP
   Author of Microsoft Outlook 2007 Programming:
     Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

Sue:

Thank you. I don't want to take too much of your time. I got this to
appear on a test form in the "General" and "P.2" tab, but not my
custom form "General" or "P.2" tab. I see the drop down, but no data.
I' think I'm past my capability of coding at this point. I still
cannot get it to accept the commas and I'm not a big coder. Am I close
or over my head at this point and need to look at other options?

Function Item_Open()

' Sets the name of page on the form (General)
Set FormPage = Item.GetInspector.ModifiedFormPages("General")

' Sets Control to a combo box called ComboBox1.
Set Control = FormPage.Controls("ComboBox1")

' Assign values to the combo box.
Control.PossibleValues = "Blue;Green;Red;Yellow"

End Function

Shawn
 
S

Sue Mosher [MVP]

You should never use PossibleValues in code. Did you look at the sample form
on the I suggested? It shows exactly how to load rows into a list box or
combo box from a delimited string.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


You would need to use code in the form's Item_Open event handler.
Seehttp://www.outlookcode.com/article.aspx?ID=32for a sample form.

Sue:

Thank you. I don't want to take too much of your time. I got this to
appear on a test form in the "General" and "P.2" tab, but not my
custom form "General" or "P.2" tab. I see the drop down, but no data.
I' think I'm past my capability of coding at this point. I still
cannot get it to accept the commas and I'm not a big coder. Am I close
or over my head at this point and need to look at other options?

Function Item_Open()

' Sets the name of page on the form (General)
Set FormPage = Item.GetInspector.ModifiedFormPages("General")

' Sets Control to a combo box called ComboBox1.
Set Control = FormPage.Controls("ComboBox1")

' Assign values to the combo box.
Control.PossibleValues = "Blue;Green;Red;Yellow"

End Function

Shawn
 
S

srm

You should never use PossibleValues in code. Did you look at the sample form
on the I suggested? It shows exactly how to load rows into a list box or
combo box from a delimited string.
--
Sue Mosher, Outlook MVP
   Author of Microsoft Outlook 2007 Programming:
     Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54





Sue:

Thank you. I don't want to take too much of your time. I got this to
appear on a test form in the "General" and "P.2" tab, but not my
custom form "General" or "P.2" tab. I see the drop down, but no data.
I' think I'm past my capability of coding at this point. I still
cannot get it to accept the commas and I'm not a big coder. Am I close
or over my head at this point and need to look at other options?

Function Item_Open()

   ' Sets the name of page on the form (General)
   Set FormPage = Item.GetInspector.ModifiedFormPages("General")

   ' Sets Control to a combo box called ComboBox1.
   Set Control = FormPage.Controls("ComboBox1")

   ' Assign values to the combo box.
   Control.PossibleValues = "Blue;Green;Red;Yellow"

End Function

Shawn

Sue:

Thank you. I will check the page again. I appreciate your time.

Shawn
 
Joined
Mar 28, 2014
Messages
1
Reaction score
0
Another option that doesn't require code is to use a "fake" comma, namely ASCII character 130: ‚

This works especially well if you're only using it for display purposes.
 

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