A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , ,

programatically editing .category





 
 
Thread Tools Display Modes
  #1  
Old May 25th 06, 04:46 AM posted to microsoft.public.outlook.program_vba
Charlie
external usenet poster
 
Posts: 64
Default programatically editing .category

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
Ads
  #2  
Old May 25th 06, 09:36 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default programatically editing .category

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

  #3  
Old May 25th 06, 03:11 PM posted to microsoft.public.outlook.program_vba
Charlie
external usenet poster
 
Posts: 64
Default programatically editing .category

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

"Michael Bauer" wrote:

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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


  #4  
Old May 26th 06, 09:30 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default programatically editing .category

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

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

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

"Michael Bauer" wrote:

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the FROM address when sending email programatically mecg96 Outlook and VBA 1 April 20th 06 10:42 PM
how to import a .vcf file into outlook programatically Darryn Lavery Outlook - Using Forms 0 March 3rd 06 04:09 PM
How to set due date for a Category of Tasks? Or set any field that applies to the whole category? prog_rammer@hotmail.com Outlook - Calandaring 1 February 4th 06 09:23 PM
Compact .PST Programatically ScoSha Outlook and VBA 1 February 1st 06 11:16 PM
Outlook 2003 - Modifying a profile programatically Paul Goldman Outlook - Installation 1 January 30th 06 05:13 PM


All times are GMT +1. The time now is 02:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Credit Card Consolidation - Loans - Mortgage Loans - Property in Spain - Gift Ideas