-
OK-kind of a fix
[VBA]
Dim objOLapp As Object 'New Outlook.Application
Dim objmailitem As Object 'Outlook.MailItem
'Dim myrecip As Object 'Outlook.Recipient
'dim withevents mysync as outlook.syncobject
Set objOLapp = CreateObject("Outlook.Application")
Set objOLapp = New Outlook.Application
Set objmailitem = objOLapp.CreateItem(olMailItem)
Application.ActivateMicrosoftApp xlMicrosoftMail
'Application.Visible = False
'Application.EnableEvents
With objmailitem
.To = "joe"
.Subject = "Report"
.Attachments.Add "report.xls"
'.Display
.Send
End With
objOLapp.Session.SyncObjects.Item(1).Start
Outlook.Application.Quit
Set objOLapp = Nothing
Set objmailitem = Nothing
Set myrecip = Nothing
[/VBA]
Syncing the object forces the send. Then in exiting, a dialog box remains for 30 seconds, giving enough time for the Send/Receive.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules