SendObject with attachment assigned by VB

  • Thread starter Brian G via AccessMonster.com
  • Start date
B

Brian G via AccessMonster.com

Hi there,
I see a number of SendObject threads but none that show how we can attach a
document other than something created directly from Access in rtf or txt or
as a snapshot

Is there a method for attaching files created independently of the SendObject
call?
 
R

Rick Brandt

Brian said:
Hi there,
I see a number of SendObject threads but none that show how we can
attach a document other than something created directly from Access
in rtf or txt or as a snapshot

Is there a method for attaching files created independently of the
SendObject call?

No. You have to automate an external messaging library (like Outlook, MAPI ,
CDO), to do that.
 
D

David C. Holley

Not to my knowledge, however I do use SendObject to output the report to
a file which is then attached to MailItem object created using the
Outlook Object Model.

Set objOutlook = CreateObject("Outlook.application")
Set newMail = objOutlook.CreateItem(olMailItem)

newMail.Body = strMsgText
newMail.to = strEmailAddress
Set newMailAttachments = newMail.Attachments
file1 = strTargetFolder & "\rptInvoice.snp"
file2 = strTargetFolder & "\rptInvoiceRemittanceAdvice.snp"
newMailAttachments.Add file1, olByValue, 1, "Invoice"
newMailAttachments.Add file2, olByValue, 1, "Remittance Advice"
newMail.Subject = "INVOICE: " & strDescription & " (" & Now() & ")"
newMail.Display

If you want to send the item automatically w/out displaying it use
newMail.Send and delete newMail.Display.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top