Hello,
I want to send an email with attachment, The files are within the Database (filed data type attachment).
I get error and I am not fully understand how to get the file to the email message.
What am I not doing right?
the table name ComplainTbl and the field called ComplainFileFld
code :
Private Sub Command31_Click()
Dim oApp As New Outlook.Application
Dim oemail As Outlook.MailItem
Set oemail = oApp.CreateItem(olMailItem)
With oemail
.To = "try@gmail.com "
.CC = ""
.Subject = " test "
.HTMLBody = "<BODY DIR=RTL STYLE='font-family:Arial ;'>" & _
" Try <br>"
.Attachments.Add Me.ComplainFilesFld.FileData, Me.ComplainFilesFld.FileType, Me.ComplainFilesFld.FileName
.Display
End With
End Sub
Its my first time with adding file to emails.