Function: Expected Equals

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top