Syncronize contact body when create task from it?

  • Thread starter Thread starter Marie J-son
  • Start date Start date
M

Marie J-son

Hi, does someone have a little code snippet for this, to run in the current
user/session ( for my self, actually..) ? Or at least a start to it or a
hint? I have coded Excel VBA a lot but are new with the objects, props and
events in outlook...

You know, when there is a contact item open and you use button/activity
"create task for user", a empty task with only the link to the Contact name
is in the new task?

A/ I need a macro to syncronize the information in the contact body, "the
note field", to the similar in the new task.
B/ When I close the taskitem, I want to syncronize it again.

The fields can contain formats and pictures...

/Kindest Regards
 
NewInspector is the event that fires when new items are opened. You declare
an Inspectors collection WithEvents so you can handle NewInspector. Then
when the item is opened in that event handler you would check for
Inspector.CurrentItem.Class to see if it's olTask. If it is you can set a
TaskItem equal to the new item and check for TaskItem.Links.Count = 1. That
would tell you that the task was opened with an entry in the Contacts field.
You could then get TaskItem.Body (the Notes field) and set a ContactItem
equal to TaskItem.Links.Item(1). That would be the related contact.
ContactItem.Body could be read and then added to TaskItem.Body.
 
Back
Top