A
acjharms
I've got a W2K template that generates a summary of selected documents.
The user is presented with a list box to choose which items are to be
summarized. I also want to send the selected documents as Outlook
e-mail attachments. I use this to start the e-mail (In the Userform
initialization)
Private Sub UserForm_Initialize()
~
mailtxt = "Assessments done " + Format(Now(), "mm/dd/yyyy")
Set maildas = CreateObject("Outlook.Application")
Set mailmsg = maildas.CreateItem(olmailItem)
With mailmsg
.To = "ASSEMAIL"
.Subject = mailtxt
.body = mailtxt
End With
End Sub
Then this to add the attachment (runs after the doc is summarized)
~
attdoc=ActiveDocument.FullName
mailmsg.Attachments.Add attdoc, olByValue, atpos, "document"
~
The code runs without an error, but the attachment isn't in the e-mail.
Any ideas? I do have a ref to the Outlook reference library.
The user is presented with a list box to choose which items are to be
summarized. I also want to send the selected documents as Outlook
e-mail attachments. I use this to start the e-mail (In the Userform
initialization)
Private Sub UserForm_Initialize()
~
mailtxt = "Assessments done " + Format(Now(), "mm/dd/yyyy")
Set maildas = CreateObject("Outlook.Application")
Set mailmsg = maildas.CreateItem(olmailItem)
With mailmsg
.To = "ASSEMAIL"
.Subject = mailtxt
.body = mailtxt
End With
End Sub
Then this to add the attachment (runs after the doc is summarized)
~
attdoc=ActiveDocument.FullName
mailmsg.Attachments.Add attdoc, olByValue, atpos, "document"
~
The code runs without an error, but the attachment isn't in the e-mail.
Any ideas? I do have a ref to the Outlook reference library.