none
Outlook form does not preserve data at receive RRS feed

  • Question

  • Hi,

    I developed a new form based on outlook message form. This form has a dropdown list, a textbox and a button. when user presses the button the values in drop down and textbox get added to a list box. The listbox has two columns and is bound to a new user field of type text. 

    When I send this form to myself. the data in dropdown and textbox are saved. But the listbox is empty. This is how I'm adding valus to my listbox.

    Function CommandButton1_Click()

    Set lst = Item.GetInspector.ModifiedFormPages("Message").Controls("ListBox1")

    Set cmb = Item.GetInspector.ModifiedFormPages("Message").Controls("cmbProjects")

    Set txt = Item.GetInspector.ModifiedFormPages("Message").Controls("txtHours")

     

    lst.AddItem  cmb.text

    lst.List(lst.ListCount - 1, 1) = txt.text

    End Function

    What did I do wrong ? Why the listbox on receive is empty ?

    Friday, January 16, 2015 5:58 PM

All replies

  • Hello Poyan,

    The list box is populated with the data by the click on the command button. Am I right? Why do you expect to get the saved state?

    Note, the data is saved only for those controls, where you specified a back-end custom property.

    Friday, January 16, 2015 6:05 PM
  • ummmm, so ... How should I get it work ? I need the listbox to be at the saved state .. because that's the main thing!!
    Friday, January 16, 2015 6:19 PM
  • Add a user-defined property (see All Fields tab) and then associate the control (list box) with the defined property in the Properties dialog.
    Friday, January 16, 2015 6:29 PM
  • I think I explained it in my main question. I already did defined a custom property of type text. and associated my listbox to this field. But it's still empty. This is why I was expecting my data to be at the saved state. I don't know how it will save a two column listbox in a text field but I have no other Idea.

    Friday, January 16, 2015 6:43 PM
  • Try using any low-level property explorer such as Outlook Spy or MFCMAPI to check out the corresponding user property. Does it exist?
    Friday, January 16, 2015 6:45 PM
  • No I didn't find anything regarding a "low-level property" that matches a listbox ... and I couldn't find any article on that :( ....
    Friday, January 16, 2015 7:40 PM
  • So, do you see properties for other controls, but not the list box. Am I right?
    Saturday, January 17, 2015 7:09 AM
  • I see all the properties available and I can assign whatever property I want to the list box. But it seems that non of them are suitable for saving this type of data. I thought I would complete this in less than 2 hours but for a little thing I'm stuck for a week !

    Monday, January 19, 2015 2:55 PM
  • Just found out something. There's no problem with list box, even when I replaced the list box with a label and changed the label caption in code and bound the value to a property of text it does not save the value for the recipient.; So there must be something wrong with changing the value dynamically !
    Monday, January 19, 2015 3:10 PM
  • I changed the control to Textbox and it worked ! It now retains data for the recipient  ... I don't know what was wrong with List box.
    Monday, January 19, 2015 3:54 PM
  • Hi,

    How do you add ListBox? Could provide the detail steps?

    Thanks

    Tuesday, January 20, 2015 9:46 AM