Search code examples
vbaoutlooklotus-noteslotuslotusscript

Create a Microsoft Outlook Task from Lotus Notes


I want to create a Microsoft Outlook Task from Lotus Notes and assign that task to someone. I create the task in LotusScript and this works fine if don't assign the task to anyone. However, I can't get the right syntax to add a name into the send to field (assign the task). Here's my code:

Const olTaskItem = 3 Dim OlApp As Variant Dim OlTask As Variant

Set OlApp = CreateObject("Outlook.Application")
Set OlTask = OlApp.CreateItem(olTaskItem)

With OlTask
    .Assign
    .Recipients.Add.Name = "Joe Soap" - PROBLEM IS HERE
    .Subject = "Neue Aufgabe - Task"
    .StartDate = Beginnt
    .DueDate = Faellig
    .Status = 1                 
    .Importance = 1             
    .Body = body
    .Display
End With

The VBA syntax to add a recipient is

.Recipients.Add Name:= "Joe Soap"

but this won't compile in Lotus Notes. Can anyone give me the correct syntax?


Solution

  • with testing (and googling) I have found that .Recipients.Add("Joe Soap") will correctly add the name "Joe Soap" to the "Send To" field providing that "Joe Soap" has previously been defined as a contact in Outlook.