Listbox spacing anomally

W

wndrbear

I have a contact form (page 2) with 4 list boxes. Each list box is linked
to a different keywords UDF. I am using a script to populate the lists and
any existing data. Note: I call the same routine to fill each list. Each
list is filled using a text file located on the locate drive.

In general, everything works great; I can create a new record select one or
multiple values and those values get saved. Then when I reopen the contact
the values are there as expected.

My Problem is that there are always 2 of the 4 list boxes that show up with
extra space between each item in the list. I can partially correct the issue
if I go in an design the form, set the "IntegralHeight" to true and then to
false (on the form in design mode all the items look good). The next time I
open the form, 2 of the 4 list boxes have that extra space (and it is not
necessarily the same 2 list boxes as before I changed the IntegralHeight).

This one really has me stumped as all list boxes are populated using the
same method, and anommally appears to be random as to which 2 lists it
affects. I've seen a simallar problem listed on other newsgroups, but there
was no answer.

Please Help!!!

P.S. I'm running Outlook 2003 with the latest service releases.

Thanks in advance

wndrbear
 
P

Paul Mac

How did you go with this one?

I had the same problem and figured a workaround. Let me know if you need it.

Paul Mac.
 
W

wndrbear

I haven't been able to work around this issue yet. I would appreciate the
details on your work around

Thanks
 
P

Paul Mac

Firstly, I tried changing the IntegralHeight property to what you had eluded
to and this didn't seem to make any changes to the display.

What I did notice was that where there are Keywords in the UDF Field that
the control is bound to, it causes the spacing anomoly. If you add the items
in code, and use the lbxControl.Selected(x) = True to add a selected property
without having the control bound, it doen't cause the same problem.

Therefore, the solution was to add another in-visible control that on the
Item_Write event the items were transferred to. Another routine was added to
the Item_Open routine, to call a procedure that would populate the listbox,
with the selected items (checking against the items to be populated from the
remote source, Text file, or in my case another public folder with items
instead). This way, the control that is bound(and invisible) has only
selected items, bound to the keyword field which would still allow you to use
the Grouping function.

First of all, the thing that helped me the most was a Form posted on Sue's
website, which demonstrates how the control can have the list items added and
removed on the Item_Open and Item_Write event.

Page > http://www.outlookcode.com/d/formcontrols.htm
Demo File > http://www.outlookcode.com/files/FormControlsDemo.zip

In Particular, look at the un-bound listboxes populated by code. This uses a
Text Field to where the output is saved, which will not give you the grouping
function.

One limitation is that I have another routune that goes through all of the
items in this folder and adds items to that listbox (as a selected item)
without interaction. The problem was that unless i passed Item.Display:
Item.Close olSave, it wouldn't update the keywords properly???

I hope that this gives you the information that you need to implement a
solution, if you need any further info, just post back.

Regards,

Paul MacNeill
 
W

wndrbear

Well, I finally got a chance to test my form with unbound controls, and
nothing has changed.

My issue does not seem to be related to whether or not I have anything in
the list selected. I can publish this form to a completely new Outlook
profile and the first time I open it, at least 2 of the boxes display the
spacing anomaly (e.g. I have 4 multiselect list boxes - we'll call them
1,2,3,4 - after opening the form for the first time, 2 & 3 may show the
spacing anomaly).

It really seems random - I can publish the exact same form to a second brand
new Outlook Profile and when I open the form up for the first time different
fields show this anomaly (e.g. this time, 1 & 2 may show the spacing anomaly)

One thing to note is that after the very first time I open the form after
publishing the fields that display the anomaly don't change unless I
re-publish the form at some point. (e.g. if listboxes 2 & 4 show the spacing
anomally when I first open it, then 2 & 4 will always show the anomally -
until I re-publish the form again)

So I'm still stumped. FYI I am using the code from the outlookcode.com that
you sent in the last post.

Any help would be appreciated as this is really starting to get annoying.

Wndrbear
 
P

Paul Findlay

Did the workaround for this happen?

I have this problem as well. It seems completely random whether you get
a double-spaced list or not. I am using Outlook 2002 and I am loading
list arrrays dynamically.

Sometimes if you toggle the "visible" or "enabled" or "Integral height"
properties the list appears to correct itself in design mode, but when
you run or publish the form the problem has come back.

With a given number of listboxes on a form, I can get at most half of
them to space correctly. I have even tried placing twice as many as I
need and hiding the half that are wrong, but toggling their visibility
property or hiding them with a frame messes up the "good" ones again!

*** Sent via Developersdex http://www.developersdex.com ***
 
P

Paul Mac

Hi Paul.

The outcome for me was in the secondlast post. From memory, the issue was
when you try to populate a list box with pre-selected items.

If you try the sequence of passing the selected items to a secondary text
file, and re-adding them to the collection on the item_open event, does it
resolve the issue for you?
If you try removing the items on the close event and add them back in on the
open (selected or not) I haven't seen this problem re-appear in my uses.

Keep posting if you cannot resolve.

Regards,

Paul.
 

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