K
KaiRich
Hi,
I want Access 2000 to send emails with attachments.
This code is automatically run by the 'system'.
I can get Access to send emails without attachments, and I
can get Access to create an email with an attachment - but
it asks me who to send it to. But I can't get it to do
both.
This is my code to send an email:
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Subject = SubjectStr
myItem.To = Recipient
myItem.Body = MsgText
myItem.Attachment = Reports("DueMonth")
myItem.Send
This is my code to create an email with an attachment:
DoCmd.SendObject acSendReport, "DueMonth", _
acFormatRTF, Recipient, , , SubjectStr, MsgText, False
In the first one
myItem.Attachment = Reports("DueMonth")
doesn't work.
In the second on it doesn't seem to load the Recipient and
send it itself.
Anyone know what's wrong?
Thanks in advance,
Kai
I want Access 2000 to send emails with attachments.
This code is automatically run by the 'system'.
I can get Access to send emails without attachments, and I
can get Access to create an email with an attachment - but
it asks me who to send it to. But I can't get it to do
both.
This is my code to send an email:
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Subject = SubjectStr
myItem.To = Recipient
myItem.Body = MsgText
myItem.Attachment = Reports("DueMonth")
myItem.Send
This is my code to create an email with an attachment:
DoCmd.SendObject acSendReport, "DueMonth", _
acFormatRTF, Recipient, , , SubjectStr, MsgText, False
In the first one
myItem.Attachment = Reports("DueMonth")
doesn't work.
In the second on it doesn't seem to load the Recipient and
send it itself.
Anyone know what's wrong?
Thanks in advance,
Kai