B
BRC
Hello All,
I have written a function to set a Outlook Task and I
have missed something. I get the Compile Error, Expected:=
What have I missed?
Here is my function:
Public Function SetTask(TaskSubject As String, TaskBody
As String, TaskPerson As String)
Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Dim myItem As Outlook.TaskItem
Dim myDelegate As Outlook.Recipient
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
myItem.Assign
Set myDelegate = OutlookTask.Recipients.Add
(TaskPerson)
myDelegate.Resolve
If myDelegate.Resolved Then
With OutlookTask
.Assign
.subject = TaskSubject
.Body = TaskBody
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Now) 'Remind 2
minutes from now.
.DueDate = DateAdd("n", 5, Now) 'Due 5
minutes from now.
.ReminderPlaySound = True
.ReminderSoundFile
= "C:\Windows\Media\Ding.wav" 'Modify path.
.Save
End With
End If
End Function
Thanks in advance.
BRC
I have written a function to set a Outlook Task and I
have missed something. I get the Compile Error, Expected:=
What have I missed?
Here is my function:
Public Function SetTask(TaskSubject As String, TaskBody
As String, TaskPerson As String)
Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Dim myItem As Outlook.TaskItem
Dim myDelegate As Outlook.Recipient
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
myItem.Assign
Set myDelegate = OutlookTask.Recipients.Add
(TaskPerson)
myDelegate.Resolve
If myDelegate.Resolved Then
With OutlookTask
.Assign
.subject = TaskSubject
.Body = TaskBody
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Now) 'Remind 2
minutes from now.
.DueDate = DateAdd("n", 5, Now) 'Due 5
minutes from now.
.ReminderPlaySound = True
.ReminderSoundFile
= "C:\Windows\Media\Ding.wav" 'Modify path.
.Save
End With
End If
End Function
Thanks in advance.
BRC