![]() |
| 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. |
|
|||||||
| Tags: category, editing, programatically |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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 | |
|
|
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 |