When checking all the tasks linked or assigned to a specific contact, you may want to print them as well. Now, in this article, we will share you a method to batch print such tasks.
To check the tasks linked or assigned to a contact, you can open this contact and access its “Activities” page, in which all such tasks are gathered here. But, if you’d like to print these tasks, you need to open them and then print one by one. Thus, obviously, it is a bit troublesome. Now, in the followings, we will introduce a way to batch print these tasks.
Batch Print All Tasks Linked or Assigned to a Specific Contact
- At the very outset, select a contact that you want.
- Then, access Outlook VBA editor by referring to “How to Run VBA Code in Your Outlook“.
- Next, copy the following VBA code into a module.
Dim objContact As ContactItem Sub PrintTasksLinkedOrAssignedToSpecificContact() Dim objStore As Outlook.Store Dim objOutlookFile As Outlook.Folder Dim objFolder As Outlook.Folder 'Get the selected contact Set objContact = Outlook.Application.ActiveExplorer.Selection.Item(1) For Each objStore In Application.Session.Stores Set objOutlookFile = objStore.GetRootFolder For Each objFolder In objOutlookFile.Folders If objFolder.DefaultItemType = olTaskItem Then Call ProcessFolders(objFolder) End If Next Next End Sub Sub ProcessFolders(ByVal objCurFolder As Outlook.Folder) Dim objTask As Outlook.TaskItem Dim objSubfolder As Outlook.Folder For Each objTask In objCurFolder.Items 'Print linked tasks to the contact If objTask.Links.Count > 0 Then i = 0 Do Until i = objTask.Links.Count i = i + 1 If objTask.Links(i).Name = objContact.FullName Then objTask.PrintOut Exit Do End If Loop 'Print assigned tasks to the contact ElseIf (objTask.Owner = objContact.FullName) Or (objTask.Owner = objContact.Email1DisplayName) Or (objTask.Owner = objContact.Email1Address) Or (objTask.Owner = objContact.Email2DisplayName) Or (objTask.Owner = objContact.Email2Address) Or (objTask.Owner = objContact.Email3DisplayName) Or (objTask.Owner = objContact.Email3Address) Then objTask.PrintOut End If Next If objCurFolder.Folders.Count > 0 Then For Each objSubfolder In objCurFolder.Folders Call ProcessFolders(objSubfolder) Next End If End Sub
- After that, click into the first subroutine.
- Later, click “Run” icon in toolbar to run this macro right now.
- When macro finishes, all the tasks linked or assigned to the selected contact will be printed out, as shown in the following screenshot.
Prevent Outlook Data Loss
When it comes to avoiding data loss, undoubtedly, regular data backups must be the first and foremost measure. The same holds true for Outlook data. That is to say, if you are not ready to lose your Outlook data, you have to make Outlook data backups on a regular basis. Besides, in order to get immediate rescue in the event of Outlook corruption, you are better off keeping a potent and credible PST repair tool, like DataNumen Outlook Repair, which is well-versed in recovering corrupt Outlook file.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql corruption and outlook repair software products. For more information visit www.datanumen.com