Listbox in Custom Form

K

kaykayit

I have modified the Contacts form to include 3 listboxes.
Two listboxes uses PossibleValues property to populate and
the third listbox has 2 columns and uses a two dimensional
array to populate. All listboxes are bound to 3 different
keywords fields. I have added the listboxes on page 2 of
the form. I have also added a textbox for each listbox on
the 1st page of the form and bound to the same field of
each listbox. I used a button on the first page to set
focus to the corresponding listbox on the second page.
Everything works fine when creating a new contact.
However, once the contact is saved, the listbox populated
by an array does not show all of the values in the array.
It only shows the values that are selected and not all the
items in the array.
Please help.
Thanx
 
S

Sue Mosher [MVP-Outlook]

Sounds like you're doing something to one-off the form, which means it will
never run code again so the Item_Open event handler doesn't run again to
populate list #3 . Using PossibleValues in code to populate the list boxes
is one known cause. See http://www.outlookcode.com/d/formpub.htm#oneoff for
others.
 
K

kaykayit

I have removed any code that lists possible values.
Instead, I have used arrays to populate all the
listboxes. Yet the problem persists. I also had a
reference to SetCurrentFormPage and I removed this. I am
still having the original problem. When I look at the
Values tab in the listbox properties, even when I use an
array it still lists the values in Possible Values.

-----Original Message-----
Sounds like you're doing something to one-off the form, which means it will
never run code again so the Item_Open event handler doesn't run again to
populate list #3 . Using PossibleValues in code to populate the list boxes
is one known cause. See
http://www.outlookcode.com/d/formpub.htm#oneoff for
 
S

Sue Mosher [MVP-Outlook]

Have you checked the status of the "send form definition with item" box?
Republished the form with an incremented version number?

If you set the possible values manually in an early design of the form,
they'll be on the controls until you remove them. They are not a cause of
one-offing.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

kaykayit

Thanks Sue for your response.
I have tried creating a new form with the list boxes and
still have the same problem.
 
S

Sue Mosher [MVP-Outlook]

Where is the form published? Did you check items created with the new form
for the obvious symptoms of one-offing -- larger size and the MessageClass
reverting to the base class? What about the "send form definition with item"
box?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

kaykayit

The form is published in the Organizational Forms
directory. The "send form definition with item" was never
checked on any version of the form. As for the
MessageClass I don't know where to look to check for the
symptoms. I tried creating a new form again but still
have the same issues.
 
S

Sue Mosher [MVP-Outlook]

You can add the Message Class field to any view.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

kaykayit

Thanks Sue so much for your help. I deleted the all
versions of the forms from the Public Folder and cleared
the cache and now Item_Open runs everytime. Now I have
the opposite problem. The items previously selected in
the listbox are cleared when reopening the Contact Item.
Is there a way to save the selection?
 
S

Sue Mosher [MVP-Outlook]

Either bind the listbox to an Outlook keywords property or write code in
Item_Write to save the data to an Outlook property as a delimited list, plus
code in Item_Open to use the information from that property to set the
selections.
 
G

Guest

The listboxes are each bound to different keyword properties. I am trying to
use the information from the keywords to set the selections.
 
S

Sue Mosher [MVP-Outlook]

If the listboxes are bound to keywords properties, they should automatically
show the selected items. Does it work if you take out the code you're using
to set the selections?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

I've tried the easy way of binding the listboxes to a keywords property.
That does not work. Is there some comprehensive Guide to VBScripting. I am
feeling my way through the dark. I am very acquainted with VBA and somewhat
acquainted with VB but it seems the scripting is a different concept.
 
S

Sue Mosher [MVP-Outlook]

Sounds like in the first case, the item may have one-offed or there was some
other problem with the code being used to fill the list box. Did you fix
that? It might help if you showed the code you're using, because I can't
duplicate your results.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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