Help Needed

aleb

Registered User.
Local time
Today, 20:17
Joined
Jun 25, 2003
Messages
296
Please help with code:
When Outlook is running procedure works OK
When Outlook is closed it gives error message. I need the code to launch Outlook if it is not running and create the task.
Thank you in advance :)
+++++++++++++++++++++++++++++++++
Private Sub SendEmailToAssignedTo_Click()
Dim myOlApp As New Outlook.Application
Dim myItem As Outlook.TaskItem
Dim myDelegate As Outlook.Recipient
Dim strImp As String
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)
myItem.Assign
Set myDelegate = myItem.Recipients.Add(Forms!Issues.Form![Assigned To E-Mail])
myDelegate.Resolve
strImp = Forms!Issues.Form.Priority
If myDelegate.Resolved Then

myItem.Subject = Forms!Issues.Form.Title
myItem.DueDate = Forms!Issues.Form.[Due Date]
If strImp = "(1) high" Then
strImp = olImportanceHigh
End If
If strImp = "(2) normal" Then
strImp = olImportanceNormal
End If
If strImp = "(3) low" Then
strImp = olImportanceLow
End If
myItem.Importance = strImp
myItem.Body = Forms!Issues.Form.Comment & " Please update database and mail-task assigned"
myItem.Display
'myItem.Send
End If
End Sub
++++++++++++++++++++++++++++++++++++
 

Users who are viewing this thread

Back
Top Bottom