Creating a copy of contact in Item_Write

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a contact entry automation where when a contact is
saved, a copy of that contact is created, some of its properties are changed
and it is to be placed in another directory.
I'v been doing this in VBScript part of the forms but the snag is that when
the copy is created it initiates a Item_Write() event and hence creates an
infinate loop which spawns tons of contacts coppies fatser the a bunny. :S
 
Set a flag that indicates an item is a copy, e.g.:

Function Item_Write()
If Item.Mileage <> "This is a copy." Then
Set newCopy = Item.Copy
newCopy.Mileage = "This is a copy"
' set more properties
newCopy.Save
' add some code to get the folder you want to move it to
newCopy.Move targetFolder
End If
End Function

FYI, there is a newsgroup specifically for Outlook forms issues "down the hall" at microsoft.public.outlook.program_forms or, via web interface, at http://www.microsoft.com/office/com...spx?dg=microsoft.public.outlook.program_forms

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top