If you’ve assigned various color categories to your Outlook tasks and now want to print the lists of tasks with different categories in different pages, you can refer to this article. Here we will share you 2 methods to get it.
In order to classify and well manage your tasks, perhaps you have applied color categories to your tasks. Now, if you would like to print out the lists of your tasks with different categories in different pages, please read on. In the followings, we will introduce you 2 means to get it.
Method 1: Manually Print Task Lists One by One
- First off, in Outlook, access “Tasks” pane.
- Then, open a Task folder.
- Next, press “Ctrl + E” to activate “Search” ribbon.
- After that, on “Search” tab, click “Categorize” button.
- From the drop down list, choose a color category.
- Then, only the tasks with the selected category will be left in the list.
- Now, go to “File” > “Print” to print out this task list.
- Subsequently, in the same way, print out the lists of tasks with the other color categories one by one manually.
Method 2: Batch Print the Task Lists by VBA
- At the very outset, trigger VBA editor with accordance to “How to Run VBA Code in Your Outlook“.
- Then, add the reference to “MS Excel Object Library” as per “How to Add an Object Library Reference in VBA“.
- Next, copy the following VBA code into a module.
Sub PrintTaskList_SpecificColorCategory() Dim objTasks As Outlook.Items Dim objTask As Outlook.TaskItem Dim objDictionary As Object Dim arrCategory As Variant Dim varCategory As Variant Dim objExcelApp As Excel.Application Dim objExcelWorkbook As Excel.Workbook Dim objExcelWorksheet As Excel.Worksheet Dim varKey As Variant Dim strKey As String Dim i As Long Dim bSheetFound As Boolean Dim nLastRow As Integer Dim objSheet As Excel.Worksheet Set objTasks = Application.Session.GetDefaultFolder(olFolderTasks).Items Set objDictionary = CreateObject("Scripting.Dictionary") 'Get All Tasks' Categories For Each objTask In objTasks arrCategory = Split(objTask.Categories, ",") For Each varCategory In arrCategory If objDictionary.Exists(Trim(varCategory)) = False Then objDictionary.Add Trim(varCategory), 0 End If Next Next 'Export the Tasks with Different Categories into Different Sheet in an Excel Workbook Set objExcelApp = CreateObject("Excel.Application") Set objExcelWorkbook = objExcelApp.Workbooks.Add objExcelApp.Visible = True i = 0 For Each varKey In objDictionary.Keys strKey = CStr(varKey) On Error Resume Next objExcelWorkbook.Sheets(strKey).Select bSheetFound = (Err = 0) On Error GoTo 0 If bSheetFound = False Then i = i + 1 If i < 4 Then Set objExcelWorksheet = objExcelWorkbook.Sheets(i) Else Set objExcelWorksheet = objExcelWorkbook.Sheets.Add(After:=objExcelWorkbook.Sheets(objExcelWorkbook.Sheets.Count)) End If objExcelWorksheet.Name = strKey End If With objExcelWorksheet .Cells(1, 1) = strKey .Cells(1, 1).Font.Bold = True .Cells(1, 1).Font.Size = 18 .Cells(2, 1) = "Subject" .Cells(2, 1).Font.Bold = True .Cells(2, 2) = "Start Date" .Cells(2, 2).Font.Bold = True .Cells(2, 3) = "Due Date" .Cells(2, 3).Font.Bold = True End With For Each objTask In objTasks If InStr(objTask.Categories, strKey) > 0 Then nLastRow = objExcelWorksheet.Range("A" & objExcelWorksheet.Rows.Count).End(xlUp).Row + 1 With objExcelWorksheet .Range("A" & nLastRow) = objTask.Subject .Range("B" & nLastRow) = objTask.startDate .Range("C" & nLastRow) = objTask.DueDate End With End If Next objExcelWorksheet.Columns("A:C").AutoFit Next 'Print out All Sheets in this Excel Workbook For Each objSheet In objExcelWorkbook.Sheets objSheet.PrintOut Next objExcelWorkbook.Close False objExcelApp.Quit End Sub
- Afterwards, press “F5” key button to run this macro right away.
- When the macro finishes, the lists of tasks with different categories will be printed in different pages, as shown in the following screenshot.
Get Back Valuable Data from Compromised PST File
If you’re subject to inaccessible PST file, your next step is undoubtedly PST repair. In this case, you can firstly try the inbox repair tool. Provided that it fails, you can proceed to try another external tool, such as DataNumen Outlook Repair. It’s able to recover PST data in quick time.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including recover mdf and outlook repair software products. For more information visit www.datanumen.com
1