I use Visual Basic 6.0 to update my Contacts in OL2000. The type of the
user-defined field "Countries" is Keywords in , whereas the type for
"BusinessAddressCountry" is text.
When I run the code as below , I received an error message stated that "
Type Mismatch: unable to coerce parameter value. outlook cannot translate
your string."
If Item.UserProperties("Countries") Is Nothing Then
Item.UserProperties("Countries") = Item.BusinessAddressCountry
Else
Item.BusinessAddressCountry = Item.UserProperties("Countries")
End If
The purpoose of this partial code is , I want both fields to have the same
values.
Since type of "Countries" is keywords, the second line of the code will
never be executed, and i don't know what's the keyword for empty value in
the drop down list box.
Could anyone help me ???????????
Thanks,
Fiona.
--
Sue Mosher
Author of
"Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours"
"Microsoft Outlook 2000 E-mail and Fax Guide"
Outlook and Exchange solutions at http://www.slipstick.com
Wong Yee Beng <won...@hitech.com.my> wrote in message
news:OZxVhQJa$GA...@cppssbbsa02.microsoft.com...
In her example, she can do something like:
Dim CountryFld as Object
Dim CountryArray as Variant
Set CountryFld = Item.UserProperties.Find("Countries")
CountryArray = CountryFld.Value
If UBound(CountryArray) = -1 Then
ReDim CountryArray(0)
CountryArray(0) = Item.BusinessAddressCountry
CountryFld.Value = CountryArray
Else
Item.BusinessAddressCountry = CountryArray(0)
End If
I didn't test the above code specifically, but it should be pretty
close. :-)
P.S. to Fiona: Note that as a Keywords field, Countries could have
multiple values; the above code only sets the BusinessAddressCountry
to the first value, ignoring any others. If you need it to contain
all values, then you'd just need to loop through CountryArray.
Phil Seeman,
TeamScope
http://www.teamscope.com