View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Steve Yandl Steve Yandl is offline
external usenet poster
 
Posts: 284
Default export to outlook task list...

I'm making the assumption that your list continues down columns A and B for
a set of tasks rather than just looking at row 1.

_____________________________________

Sub LoadTasks()

Const olFolderTasks = 13

Dim r As Integer
Dim x As Integer

r = Range("A65536").End(xlUp).Row

Set ol = CreateObject("Outlook.Application")
Set ns = ol.GetNamespace("MAPI")
Set olFolder = ns.GetDefaultFolder(olFolderTasks)

For x = 1 To r
Set taskItem = olFolder.Items.Add
With taskItem
.Subject = Sheets("Sheet1").Cells(x, 1).Value
.DueDate = Sheets("Sheet1").Cells(x, 2).Value
.Save
End With
Next x

Set taskItem = Nothing
Set ns = Nothing
Set ol = Nothing

End Sub

______________________________________

Steve Yandl
wrote in message
ups.com...
I'm creating a journaling utility for my coworkers. I need a macro
that takes the contents of a cell and exports as a new task in
Outlook. Specifically...

...a subject is entered into A1 (Deliver plans to consultant)
...a due date is entered into B1 (6/20/2007)
...a macro takes the contents of A1 and B1 and creates a Task in
Outlook so that when Outlook Task list is brought up, the task is
there.

I know just about anything is possible with Excel VBA. Can anyone
help me?