programatically editing .category

G

Guest

I have a macro asigned to a button on for my contacts which does several
things, including copying the mailing address to the clipboard. I need it to
edit the category field, also.

what I'm needing is to have it add the contact to the field "Mail In" and
check to see if it's in the category "Mail Out" and so, remove it from that
category. The problem I run into it that my contacts are in other
categories, also. Maybe 2, 3 or only one. So, if the contact is in the
category called "Mail Out", that might be at the beginning, middle, or end of
the data in the category field. I don't want to change any of the other
categories the contact may be in.
Thanks,
ck
 
M

Michael Bauer

Am Wed, 24 May 2006 19:46:01 -0700 schrieb Charlie:

Categories are usually semicolon separated. You can split the Categories
property into an array of Strings with:

Dim arr() as String
arr=Split(.Categories, ";")

Now you can loop through arr from 0 to Ubound(arr) and check each single
category easily.
 
G

Guest

Thanks! I've used the Split() once before, that sounds good. I'm not sure
about the syntax of the Loop though...
It is a Do/Loop statement I'd use? How do I incorporate the 0 - Ubound(arr)
into a loop?
thanks,
ck
 
M

Michael Bauer

Am Thu, 25 May 2006 06:11:02 -0700 schrieb Charlie:

Dim i&
For i=0 To Ubound(arr)
....
Next
 

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