G
Gary B
Hi there,
I have a form, with a subform.
The subform has an "attachment" field.
This subform is displayed in datasheet format on the main form.
I have code on the main form ,attached to a cmdButton, that sends an email.
I now wish to amend that code so that the attachment is attached to the
email - if there is one.
Dim App As Object
Dim Itm As Object
Dim strAttachmentname
Set App = CreateObject("Outlook.Application")
' all str variables defined and represent values on the main form
' get the attachment name if there is one ????? (this is what I need)
' what if there is more than one record on the subform and there are
different attachments ? I need them all
Set Itm = App.CreateItem(0)
With Itm
.Subject = strSubject
.To = strSendto
.CC = strCCTo
.Body = strBodyTxt
.Attach(strattachmentname) ???
.Display (so user can amend email before sending)
End With
I have a form, with a subform.
The subform has an "attachment" field.
This subform is displayed in datasheet format on the main form.
I have code on the main form ,attached to a cmdButton, that sends an email.
I now wish to amend that code so that the attachment is attached to the
email - if there is one.
Dim App As Object
Dim Itm As Object
Dim strAttachmentname
Set App = CreateObject("Outlook.Application")
' all str variables defined and represent values on the main form
' get the attachment name if there is one ????? (this is what I need)
' what if there is more than one record on the subform and there are
different attachments ? I need them all
Set Itm = App.CreateItem(0)
With Itm
.Subject = strSubject
.To = strSendto
.CC = strCCTo
.Body = strBodyTxt
.Attach(strattachmentname) ???
.Display (so user can amend email before sending)
End With