clvestin
11-04-2006, 10:59 PM
I am running Office 2003. Using the following code segment
Dim objOLapp As Object 'New Outlook.Application
Dim objmailitem As Object 'Outlook.MailItem
Dim myrecip As Object 'Outlook.Recipient
Set objOLapp = CreateObject("Outlook.Application")
'Set objOLapp = New Outlook.Application
Set objmailitem = objOLapp.CreateItem(olMailItem)
Set myrecip = objmailitem.Recipients.Add("joe blow")
myrecip.Resolve
With objmailitem
.To = Recipients
.Subject = " Morning Report"
.Attachments.Add "S:\PV\report.xls"
.Display
.Send
End With
Set objOLapp = Nothing
Set objmailitem = Nothing
Set myrecip = Nothing
I presumed that the set as new outlook would open the application. It doesn't seem to. The .display line does show the email.
The big issue facing me is that the mail does not send until i subsequently open Outlook and it performs a Send/Recieve. Outlook is set to send/recieve online/offline. Aware that the object model has a lot of new security restraints, but any suggestions for what should be a simple issue would be appreciated.
I resubmitted this request since the forum previously had a habit of kicking me.
Dim objOLapp As Object 'New Outlook.Application
Dim objmailitem As Object 'Outlook.MailItem
Dim myrecip As Object 'Outlook.Recipient
Set objOLapp = CreateObject("Outlook.Application")
'Set objOLapp = New Outlook.Application
Set objmailitem = objOLapp.CreateItem(olMailItem)
Set myrecip = objmailitem.Recipients.Add("joe blow")
myrecip.Resolve
With objmailitem
.To = Recipients
.Subject = " Morning Report"
.Attachments.Add "S:\PV\report.xls"
.Display
.Send
End With
Set objOLapp = Nothing
Set objmailitem = Nothing
Set myrecip = Nothing
I presumed that the set as new outlook would open the application. It doesn't seem to. The .display line does show the email.
The big issue facing me is that the mail does not send until i subsequently open Outlook and it performs a Send/Recieve. Outlook is set to send/recieve online/offline. Aware that the object model has a lot of new security restraints, but any suggestions for what should be a simple issue would be appreciated.
I resubmitted this request since the forum previously had a habit of kicking me.