Storing userproperties to array

Status
Not open for further replies.

jepp

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Hello.
I am trying to record all values on contact open event and save them to array.
I have two arrays. cData, which will store data from object objContact and pName which already stores names of custom fields in contact.

If I type
cData(i) = objContact.UserProperties("(040) ID person") ,
everything works ok, but if I type
cData(i) = objContact.UserProperties(pName(i)) ,
I get run-time error 91. And pName(i) have the same data as I typed it in the first line that works.

Can someone help me and explain what's happening.
Thanks.
 
Can you share the cause so others who run into the same error might learn from it?
Hi Diane
Array pName which stores names of custom fields in a contact, was created from a string of all the names, divided with chr(10). When I split this string in to array pName , items had string name & chr(10). So, I had to clen chr(10) from items in array. Just stupid mistake.
 
Thanks for the update!
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
O Storing Multiple Selections Outlook VBA and Custom Forms 1
H Storing an email along with its attachments? Outlook VBA and Custom Forms 1
D Cannot populate certain UserProperties in Outlook from Excel Outlook VBA and Custom Forms 2
W Appointment userproperties disappear Outlook VBA and Custom Forms 4
mrmmickle1 UserProperties VBA to move message to another folder Outlook VBA and Custom Forms 7
N Get the seconds with userproperties.add method VBA Outlook Outlook VBA and Custom Forms 4
R How to search for blank userproperties field Outlook VBA and Custom Forms 4
M Assigning Values to Contact UserProperties Outlook VBA and Custom Forms 1
S UserProperties of MailItem object. Outlook VBA and Custom Forms 3
V Difference between UserProperties and ItemProperties? Outlook VBA and Custom Forms 4
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
G [Help] Converting array to destination folder path Outlook VBA and Custom Forms 1
Treebys Array out of bounds .display 2016 Outlook VBA and Custom Forms 3
Dr. Demento Outlook output to array -> Excel & re-format Using Outlook 2
L Outlook clients did not reconnect to Exchange when one CAS server in CAS array became unresponsive Exchange Server Administration 1
A Why not using DAG virtual IP/fqdn for CAS array in two nodes setup? Exchange Server Administration 2
G How to insert a json array into a calendar events Outlook VBA and Custom Forms 1
S MAcro - Need help in getting the recipients in to filed / cc field toput in an array Outlook VBA and Custom Forms 4
H Attachment Array? Outlook VBA and Custom Forms 5
H Using Array for Attachments? Outlook VBA and Custom Forms 1
A message body- find any words in my array? Outlook VBA and Custom Forms 2

Similar threads

Back
Top