Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Script to read shared tasks in Outlook

Reply
 
Old 09-30-2009   #1 (permalink)
The Capn


 
 

Script to read shared tasks in Outlook

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:

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
I'd appreciate any sugggestions.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Using PowerShell script to create a list of Scheduled tasks PowerShell
How can I import Outlook tasks? Vista mail
Shared Printer - Script Vista networking & sharing
Outlook 2000 tasks Microsoft Office
Run tasks asynchronously: external files vs. script blocks PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46