Hi all
I already post this Q on a different thread but because theinitial subjet was for a different task I've not got an answer. This code works, but it only send the msg when Outlook is open. How can I do to send it still if outlook is close? Is there a way of knowing if outlook is running?
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
'***creates and sends email
With objEmail
.To = DistributionList
.Subject = SubjectText
.Body = BodyText
If EditMsg = True Then
.Display
Else
.Save
.Send 'sends the email in Outlook. Change to DISPLAY if you want to be able to modify or see what you have created before sending the email
End If
End With
'**closes outlook
'objOutlook.Quit
Set objEmail = Nothing
Thanks
Dan
I already post this Q on a different thread but because theinitial subjet was for a different task I've not got an answer. This code works, but it only send the msg when Outlook is open. How can I do to send it still if outlook is close? Is there a way of knowing if outlook is running?
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
'***creates and sends email
With objEmail
.To = DistributionList
.Subject = SubjectText
.Body = BodyText
If EditMsg = True Then
.Display
Else
.Save
.Send 'sends the email in Outlook. Change to DISPLAY if you want to be able to modify or see what you have created before sending the email
End If
End With
'**closes outlook
'objOutlook.Quit
Set objEmail = Nothing
Thanks
Dan