I'm attempting to write a script for my office that will read other peoples'
shared tasks from Outlook 2003 and write them to some destination (in this
case, Excel). So far, I've been able to do so for my own tasks, but I'm at a
loss with how to find someone else's tasks.
Here's the working code I have pieced together so far:
I'd appreciate any sugggestions.Code:' Inputs all active tasks from Outlook ' and exports into Excel Dim objOutlook Dim objNameSpace Dim objFolder Dim CurrentTask Set objOutlook = CreateObject("Outlook.application") Set objNameSpace = objOutlook.GetNameSpace("MAPI") Set objFolder = objNameSpace.GetDefaultFolder(13) Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.Workbooks.Add Set objSheet = objExcel.ActiveWorkbook.Worksheets(1) 'Renames current sheet objSheet.Name = "Today's Tasks" ' Column Headings objSheet.Cells(1, 1).Value = "Task Name" objSheet.Cells(1, 2).Value = "Start Date" objSheet.Cells(1, 3).Value = "Due Date" 'Makes Line 1 bold objSheet.Range("1:1").Font.Bold = True 'Populates the Excel File with all non-completed tasks intTaskCount = 1 For Each CurrentTask in objFolder.Items If CurrentTask.Complete = False Then objSheet.Cells(intTaskCount + 1,1).Value = CurrentTask.Subject objSheet.Cells(intTaskCount + 1,2).Value = CurrentTask.StartDate objSheet.Cells(intTaskCount + 1,3).Value = CurrentTask.DueDate intTaskCount = intTaskCount + 1 End If Next ' Format columns to a specified width objExcel.Columns(1).ColumnWidth = 40 objExcel.Columns(2).ColumnWidth = 10 objExcel.Columns(3).ColumnWidth = 10 Set objFolder = Nothing Set objNameSpace = Nothing set objOutlook = Nothing


