[SOLVED] Code to insert attachment in email (Access)
Hi guys, I've been stuck with this for very long, searching everywhere to no avail.. I'm using an Attachment box on my access form. And I'm working on coding that can allow me to open outlook with clicking a button & the address, attachment etc. should be filled in. I've gotten the email part, however, i am having problem putting the attachment in the email.
Currently this is what I have for the attachment part,
**Scan_Doc is the name i use for the Attachment control.
The problem is, when i insert debug on the line Scan_Doc.FileURL(i), it keep showing that the string is empty, even with 1 attachment count!
Can someone help me see what is the problem here
Hi guys, I've been stuck with this for very long, searching everywhere to no avail.. I'm using an Attachment box on my access form. And I'm working on coding that can allow me to open outlook with clicking a button & the address, attachment etc. should be filled in. I've gotten the email part, however, i am having problem putting the attachment in the email.
Currently this is what I have for the attachment part,
Code:
Dim i As Integer
'The following code is for counting the number of attachment:
If Scan_Doc.AttachmentCount() > 0 Then
For i = 0 To Scan_Doc.AttachmentCount() - 1
'Adding each attachment
mailItem.Attachments.Add (Dir(Scan_Doc.FileURL(i)))
Next
Else
MsgBox "There are no attachments - Please check.."
End If
**Scan_Doc is the name i use for the Attachment control.
The problem is, when i insert debug on the line Scan_Doc.FileURL(i), it keep showing that the string is empty, even with 1 attachment count!
Can someone help me see what is the problem here
Last edited: