L
Looping through
I have the following code that work somewhat okay when I create a new Task
record. Where I start running into problems is with the "With" Statement,
Specifically the
..Body = c.Offset(0, 2).Value
..DueDate = c.Offset(0, 5).Value
Options...
I am trying to get my code to pick specific information out of the row the
user starts the macro on to set up the task with limited interaction with the
user. If I change the above to
.Body = "Anything"
.DueDate = "3/25/08"
Everything works fine. But again this information is specific to my code and
does not allow for customized tasked based on user control.
Option Explicit
Sub CreateNewTask()
Dim olApp As Object
Dim olTsk As Object
Dim c As Range
Set olApp = CreateObject("outlook.application") ' New Outlook.Application
Set olTsk = olApp.CreateItem(3) ' OLTaskitem
With olTsk
.Subject = "Follow Up on Quote"
.Status = 1 ' olTaskInProgress
.Importance = 2 ' olImportanceHigh
.Body = c.Offset(0, 2).Value
.DueDate = c.Offset(0, 5).Value
.TotalWork = 40
.ActualWork = 20
.Display
.Save
End With
Set olTsk = Nothing
Set olApp = Nothing
End Sub
Can some one help and point me in the right direction.
Thanks
Peter W
record. Where I start running into problems is with the "With" Statement,
Specifically the
..Body = c.Offset(0, 2).Value
..DueDate = c.Offset(0, 5).Value
Options...
I am trying to get my code to pick specific information out of the row the
user starts the macro on to set up the task with limited interaction with the
user. If I change the above to
.Body = "Anything"
.DueDate = "3/25/08"
Everything works fine. But again this information is specific to my code and
does not allow for customized tasked based on user control.
Option Explicit
Sub CreateNewTask()
Dim olApp As Object
Dim olTsk As Object
Dim c As Range
Set olApp = CreateObject("outlook.application") ' New Outlook.Application
Set olTsk = olApp.CreateItem(3) ' OLTaskitem
With olTsk
.Subject = "Follow Up on Quote"
.Status = 1 ' olTaskInProgress
.Importance = 2 ' olImportanceHigh
.Body = c.Offset(0, 2).Value
.DueDate = c.Offset(0, 5).Value
.TotalWork = 40
.ActualWork = 20
.Display
.Save
End With
Set olTsk = Nothing
Set olApp = Nothing
End Sub
Can some one help and point me in the right direction.
Thanks
Peter W