You cannot access the value of a custom keywords property directly. Instead, you must go through the control: To get the selected values from a multi-select list box, you cannot use ListIndex. Instead, you need to loop through all the items in the list and check the Selected property for each one. Form with sample code at
http://www.outlookcode.com/files/FormControlsDemo.zip
For more info on working with list boxes, see
http://www.outlookcode.com/d/formcontrols.htm#listcombo
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Michael Anderson" wrote in message ...
Hi,
i am working on a customised contact form. I have a keyword type ListBox
"ListBox3" with a field called "mxzNCRL2". It has 3 possible values:
Bunnings;Forklift;First Aid. I am trying to get the selected value or values
onto a text variable.
Dim txtmxzNCRL2
Dim objInspector
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile("c:\testfile.txt", True)
Set objInspector = Item.GetInspector
txtmxzNCRL2 = Item.UserProperties("mxzNCRL2").Value
MyFile.WriteLine(txtmxzNCRL2)
MyFile.Close
Set fso = Nothing
Set objInspector = Nothing
I am told that I have a type mismatch and it doesn't read in the selected
value or values.
Any suggestions?
--
Thank You in Advance,
Michael Anderson