export to outlook task list...
On Jun 14, 3:56 pm, "Steve Yandl" wrote:
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
______________________________________
I got a "Assignment to Constant not permitted" error for *Set olFolder
= ns.GetDefaultFolder(olFolderTasks)* What does that mean?
|