How to Auto Create a Task to Call the Contact Person Later when Flagging an Outlook Contact

When flagging a contact, some users hope to get a standard Outlook task in To-Do List instead of a flagged contact. Now, in this article, we will introduce a method to let Outlook auto create a task for call the contact person later when flagging a contact.

As we all know, when flagging a contact, the contact will display in the To-Do list. But, most of time, what we really want is a standard task for calling this contact later and contains the telephone numbers of the contact only in task body. Hence, here we will introduce a method to configure Outlook to auto create such a task. Read on to get more details.

Auto Create a Task to Call the Contact Person Later when Flagging a Contact

  1. At first, launch Outlook VBA editor with reference to “How to Run VBA Code in Your Outlook“.
  2. Then, open the “ThisOutlookSession” project and put the following code into it.
Private WithEvents objContacts As Outlook.Items

'Works for contacts in the default Contact folder
Private Sub Application_Startup()
    Set objContacts = Outlook.Application.Session.GetDefaultFolder(olFolderContacts).Items
End Sub

Private Sub objContacts_ItemChange(ByVal Item As Object)
    Dim objContact As Outlook.ContactItem
    Dim objTask As Outlook.TaskItem

    If TypeOf Item Is ContactItem Then
       Set objContact = Item

       If objContact.IsMarkedAsTask = True Then
          If objContact.TaskCompletedDate = "1/1/4501" Then
             'Create a task for calling this contact
             Set objTask = Outlook.Application.CreateItem(olTaskItem)
             With objTask
                  .Subject = "Call " & objContact.FullName
                  .StartDate = objContact.TaskStartDate
                  .DueDate = objContact.TaskDueDate
                  .Attachments.Add objContact
                  .Body = "Business: " & objContact.BusinessTelephoneNumber & vbCr & "Home: " & objContact.HomeTelephoneNumber & vbCr & "Other: " & objContact.OtherTelephoneNumber & vbCr & vbCr
                  .ReminderSet = True
                  .ReminderTime = objContact.ReminderTime
                  .Save
                  .Display
             End With
             objContact.ClearTaskFlag
             objContact.Save
        End If
      End If
   End If
End Sub

VBA Code - Auto Create a Task to Call the Contact Person Later when Flagging a Contact

  1. After that, put cursor in the “Application_Startup” subroutine and press “F5” key to activate this macro.
  2. Finally, exit the VBA editor and try this macro right away.
  • Select or open a contact and flag it.Flag a Contact
  • At once, a new task will be displayed, like the following screenshot.Popup Task
  • Meanwhile, as you can see, the contact’s flag is automatically removed.

Repair Compromised PST Files

Like Word documents, Outlook PST file is also prone to corruption. Many users have been plagued by the problems related to inaccessible PST files. Fortunately, Outlook comes pre-installed with an inbuilt repair utility – Scanpst. It is indeed able to fix a majority of small PST issues. Yet, when confronting seriously corrupt PST file, it seems ineffective. Thereby, at that time, you have to take aid of a more powerful tool, like DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql recovery and outlook repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *