Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Jun 2001
    Location
    USA
    Posts
    708
    Thanks
    48
    Thanked 1 Time in 1 Post

    Delete a Category from Multiple Contacts (2002)

    Hello:

    I have removed the custom category "Debate" from my master category list for contacts.

    Yet some 250 of my contacts still retain this category in their category fields.

    Is there any way I can automatize the process to remove the debate category from all contacts who have it?

    Much thanks,

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete a Category from Multiple Contacts (2002

    There doesn't seem to be much in the Outlook object model at this level of detail. You might get some mileage out of exporting your Contacts to a *.csv (comma separated values) file and then editing them in Excel. Back-up as necessary. HTH
    Gre

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Delete a Category from Multiple Contacts (2002)

    I think you could do something like this. Of course, I haven't tested it! Bear in mind that if Debate appears in a list, extra delimiters may be left behind, resulting in the creation of a blank or null category. If you test on a small set and find this, you could add a second Replace statement to eliminate any double-delimiters. And I guess there might be beginning-of-line delimiters, and end-of-line delimiters... it could be several string function tweaks.

    <pre>Dim aContact As ContactItem
    If MsgBox("This will operate on the current folder. Okay?", vbQuestion + vbYesNo) _
    = vbNo Then Exit Sub
    For Each aContact In ActiveExplorer.CurrentFolder.Items
    With aContact
    .Categories = Replace(.Categories, "Debate", "", , , vbTextCompare)
    .Save
    End With
    Next</pre>

    You could economize on needless saves by first checking whether the Debate category existed in the contact before mucking with it. Etc. Etc. Hope this helps.

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete a Category from Multiple Contacts (2002

    Jefferson, I stand corrected; although I had mixed success in running it. <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23>
    Gre

  5. #5
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Los Angeles, California, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete a Category from Multiple Contacts (2002)

    I'd add that category back into my Category list, then sort my contacts by Category, then Select the affected Contacts, then go to Edit, Categories and uncheck the relevant category box, then delete the category from the list. That should remove the category from the contacts.

  6. #6
    5 Star Lounger
    Join Date
    Jun 2001
    Location
    USA
    Posts
    708
    Thanks
    48
    Thanked 1 Time in 1 Post

    Re: Delete a Category from Multiple Contacts (2002

    Hi,

    Alas, this doesn't work as expected.

    Thanks anyway.

  7. #7
    5 Star Lounger
    Join Date
    Jun 2001
    Location
    USA
    Posts
    708
    Thanks
    48
    Thanked 1 Time in 1 Post

    Re: Delete a Category from Multiple Contacts (2002)

    This works perfectly! Thanks so much; it's exactly what I needed!

  8. #8
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Los Angeles, California, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete a Category from Multiple Contacts (2002)

    Glad it helped. I know only a little about coding in VBA and want to keep it that way. I still get stuff done!

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Delete a Category from Multiple Contacts (2002)

    I was thinking when I read your post: coming to a new (and frustrating) Office application with a better knowledge of VBA than the application's features is a real temptation to waste time building features that exist. Hammer... nail... I speak from experience!

    (I also think it violates some kind of referential integrity model to let you delete a category without removing the category from the individual items, but... Outlook has its own unique rules.)

  10. #10
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Los Angeles, California, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete a Category from Multiple Contacts (2002)

    Should we submit this to Woody's Outlook Feature Wishlist?
    <hr>...it violates some kind of referential integrity model to let you delete a category without removing the category from the individual items...<hr>

    Forget about nails, sometimes I feel like taking the hammer to my PC. Fortunately this Outlook gaffe can be undone.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •