Combo Box Values in Custom Form

T

thequietDOMINO

Hi,
I have a custom form with two combo boxes which are programmatically
populated with values using the .AddItem method from an Access database
before being sent. The combo boxes are each bound to a separate User Defined
Field. I can see the values in the drop downs before the email is sent, but
then when it is received the combo boxes are blank. Also, if I open up the
sent item, the combo boxes are no longer populated.
 
H

Hollis Paul

I have a custom form with two combo boxes which are programmatically
populated with values using the .AddItem method from an Access database
before being sent. The combo boxes are each bound to a separate User Defined
Field. I can see the values in the drop downs before the email is sent, but
then when it is received the combo boxes are blank. Also, if I open up the
sent item, the combo boxes are no longer populated.
You need to force the email to be sent using the TNEF wrapper. This is done by
setting the "Always send to this recipient using rtf" property.
 
T

thequietDOMINO

Thanks for your response. However, my company has created some sort of custom
form that displays when I click on the email address. Is there any other way
to set this property, perhaps programmatically?
 
H

Hollis Paul

Thanks for your response. However, my company has created some sort of custom
form that displays when I click on the email address. Is there any other way
to set this property, perhaps programmatically?
Perhaps you should go back to square one and start the tale from there. You
have a form, which I have assumed is an Outlook form. Is it really an Outlook
form? What version of Outlook is being used, if it is being used? Are you sure
it is not an Access form? It displays when you click on an email address?
Where is that email address? Is it in an Access table, perhaps?

We can play 20 questions, if you insist, but it will probably take 20 days to
get through the all. Were I a dentist, and I had to pull 20 teeth, it would
probably be better to do them in one sitting, or perhaps two or three; but
surely not 20.
 
T

thequietDOMINO

Okay, here's the barebones of my problem:
1. I have designed a Custom Form in Outlook 2003.
2. This form has two combo boxes that are populated programmatically from an
Access database.
3. When I send the form, the values in the combo box are not retained.
4. Your suggestion was that it needs to be sent using the TNEF wrapper by
selecting the "Always send to this recipient using rtf" option, which is
found by selecting the properties of any email address as listed in the To:
field.
5. I believe that my company has made some sort of modification to the
window that is displayed when a user selects the properties of an email
address (either by double-clicking the email address in the To: field, or by
clicking on the email address in Contacts) so that there are several custom
fields, none of which are the original "Always send to this recipient using
rtf" option.
6. Is there another way to have this option selected besides by selecting it
through the email address properties?
Thanks
 
T

thequietDOMINO

Not sure if this is relevant, but I also have a textbox on the form that is
populated from Access as well, and this field retains the values when sent.
All controls are bound to User Defined Fields.
 
H

Hollis Paul

4. Your suggestion was that it needs to be sent using the TNEF wrapper by
selecting the "Always send to this recipient using rtf" option, which is
found by selecting the properties of any email address as listed in the To:
field.

6. Is there another way to have this option selected besides by selecting it
through the email address properties?
In Outlook 2003, this is done by opening the contact form for the recipient
(from the contacts folder), right-clicking the email address that is being
used, and choosing Outlook properties. Once that panel opens there is a
drop-down list box at the bottom that is labeled "Internet Format". The third
option in that list is "Send using Outlook Rich Text Format". Select that
option and do a test send to see if the data is retained as you expect.
 
H

Hollis Paul

Not sure if this is relevant, but I also have a textbox on the form that is
populated from Access as well, and this field retains the values when sent.
All controls are bound to User Defined Fields.
You need to tell what the name of the form, to which you made your changes,
is. Which was it? A contacts form, a message form, or ...?
If this is the control named Notes or body, or something like that, then one
would expect that to work properly, as it is the primary payload of an email
message.
The beatings will continue until morale improves.
Of course. That is the way it works. But note, we are talking about the
morale of the beater, not the beatee.
 
T

thequietDOMINO

In Outlook 2003, this is done by opening the contact form for the recipient
(from the contacts folder), right-clicking the email address that is being
used, and choosing Outlook properties. Once that panel opens there is a
drop-down list box at the bottom that is labeled "Internet Format". The third
option in that list is "Send using Outlook Rich Text Format". Select that
option and do a test send to see if the data is retained as you expect.

1. My form is based on the message form.
2. When I right-click on the email address in Contacts, a different "panel"
or form or window or whatever comes up than the standard one. This modified
panel does not have any of the standard options on it. Is there any other way
to designate the rtf format?
Thanks
 
H

Hollis Paul

2. When I right-click on the email address in Contacts, a different "panel"
or form or window or whatever comes up than the standard one. This modified
panel does not have any of the standard options on it. Is there any other way
to designate the rtf format?
Are you actually opening a contact first? Are you just finding the name in the
Contacts folder, right-clicking that, and getting a list like Open, Print,
Forward, New Message to Contact? If it is not that, what do you actually see?

If you open a contact item, go to the "All Fields" tab, select all Contact
Fields in the field category selector, and then look at MessageClass. If it is
not "IPM.Contact", without the quotes, then you may have to redesign that custom
form also.

There used to be a setting in the Message Options so that you could force rtf
format when sending the message, but I am not finding that in a new message
here. It is possible that it can be set in code in the Item_Send event, using
the Message Properties collection, but I have never done that, and can't say how
it is done. You have to look up what is available in the Outlook Object model.
Do you know how to code using the Outlook Object model?
 
T

thequietDOMINO

Ok, so I'm sending the custom form to myself to see if it works. When I
receive it, if I go to File -> Properties, the "Type" field says "(Rich
Text)" yet the combo boxes are still blank. Is there anything else that could
be wrong?
Thanks
 
H

Hollis Paul

Ok, so I'm sending the custom form to myself to see if it works. When I
receive it, if I go to File -> Properties, the "Type" field says "(Rich
Text)" yet the combo boxes are still blank. Is there anything else that could
be wrong?
Apparently, something else is wrong. Try the following test: Save and Close
the message without sending it. When you open it, is the data still in the
combo boxes? If it is, now send it to yourself. Does the data survive?
 
H

Hollis Paul

When I save it and open it up again, the data is no longer there.
Well, that isn't how things should work. Lets try a new experiment.
Open a new message in design mode. Make sure the "Separate Read
Layout" option on the Forms menu is unchecked. Drag and drop two
combo-boxes on P2 and bind them to the Outlook fields Billing
Information and Mileage. You will find them on the list in the
category of All Mail Fields. Publish the form giving it a unique name.
Create a new data item from your new form, enter some data into the
combo-boxes, and send it. Do a second test by filling in some data in
the combo boxes and save and close it.

In my test, I sent the message to myself, and the data was still there,
but I couldn't open it again; getting the message that I didn't have
the required permissions. Boggles the mind. I could open it again
from the sent items folder. The data was still in the combo boxes.

In the second test, the data was still in the combo boxes when I opened
them from the drafts folder. And I could open the item again.

I conclude that you should redesign your form, starting over from
scratch. But, lets see what your tests reveal.
 
T

thequietDOMINO

Okay, I conducted both tests and in both cases, the data was retained.
Additionally, I did the same thing with my original form and that also
worked. Could there be something wrong with the code I'm using to populate
the combo boxes in the first place? I don't see how as the data is correctly
shown in the combo box before being sent. Another bit of information which
may or may not be helpful, the code which instantiates the form and populates
it is running in Access, not Outlook. Any other thoughts?
Thanks
 
H

Hollis Paul

Another bit of information which
may or may not be helpful, the code which instantiates the form and populates
it is running in Access, not Outlook. Any other thoughts?
There are many things that can one-off an Outlook form, which means that a lot
of things will not work properly. The first thing to check is the Message Class
field. Create a new one, take it into design mode, click the All Fields tab,
select the All Mail Fields category, and look at the value in the Message Class
field. If it does not have your custom form name there, that is,
IPM.Note.MyFormName, then it is one-offed. Then we have to figure out what went
wrong.
 
T

thequietDOMINO

I created an instance of the form both manually and through the code and
checked the message class before sending and after receiving and in every
case the message class was the correct one (i.e. IPM.Note.CustomFormName)
 
T

thequietDOMINO

Additionally, I put a MsgBox for each of the User Defined Field that the
combo boxes are bound to in the CustomPropertyChange event to see what they
are when the combo boxes are getting populated (because I'm confused how one
field can hold all the combo box values) and the MsgBox never popped up.
Shouldn't it show up when I do an addItem to the combo box?
 
H

Hollis Paul

Could there be something wrong with the code I'm using to populate
the combo boxes in the first place? I don't see how as the data is correctly
shown in the combo box before being sent.
Let us look at this part of the problem. Is your code placing the data in the
control or in the field? And what is the type of field that the control is
bound to. Go to www.outlookcode.com and find an example of filling a combobox,
and see how your code compares to that.
 

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