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

ItemChange Event to Propagate Contacts



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 24th 09, 06:13 PM posted to microsoft.public.outlook.program_vba
C. Collings
external usenet poster
 
Posts: 2
Default ItemChange Event to Propagate Contacts

Hi,

I am trying to use the ItemChange event on Contacts.Items to execute VBA
code that will propagate the change to a contacts folder in my local PST file.

My question is two-part:
1. When I delete a contactitem from the contacts folder, the ItemChange
event fires and copies the deleted item to my PST file. How can I
distinguish the difference between changing an item or deleting an item using
VBA? If I also add code for the ItemRemove Event, will both events still
fire?

2. When I manually copy a contactitem from one folder to another it asks if
I want to update with changes or copy as a new item? When I propagate a
changed item using VBA, it adds the changed item as a new item rather than
merging the changed item with the existing item and doesn't give me an
option? Is there something I can do differently?

Sub ContactsFolder_ItemChange(ByVal Item As Object)
If InStr(Item.Categories, "Keyword") 0 Then
Dim Destination_Folder As MAPIFolder
Set Destination_Folder = GetFolder("Mailbox - Keyword\Contacts")
Set ContactItemCopy = Item.Copy
ContactItemCopy.Move Destination_Folder
Else
Set Destination_Folder = GetFolder("Mailbox - Local\Contacts")
Set ContactItemCopy = Item.Copy
ContactItemCopy.Move Destination_Folder
End If
End Sub

Thanks,
Collings
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
ItemRemove event stop firing, ItemAdd & ItemChange still work Jason Add-ins for Outlook 3 March 4th 09 11:24 PM
itemchange event in public (exchange) folder occurs if nothing is changed MIchael Outlook and VBA 7 May 23rd 07 11:04 PM
ItemChange event is modifying my Calendar Events mark Add-ins for Outlook 4 November 6th 06 10:17 PM
Propagate the same user for multiple folders in Outlook FPerkins Outlook - General Queries 1 June 29th 06 04:08 PM
Mapi Folder Items ItemChange event is not firing AtulSureka Outlook and VBA 3 February 5th 06 06:25 PM


All times are GMT +1. The time now is 06:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.