Hi Everyone,
I am trying to send a mail frm Access on a button click.
It works very well.
I am using the following code :
Dim SubjectLine As String
Dim strFilePath As String
Dim PersonSendTo As String
PersonSendTo = "info@info.com"
SubjectLine = "My Subject"
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = PersonSendTo
.Subject = SubjectLine
.Attachments.Add "attachemntfile.htm"
.Send
End With
The above code works fine. In the attachmentfile.htm (its a 2 page text) which i want to be displayed in the body of the mail and not as attachemnt. How to do it? I tried using HTMLBody, but that i need to type in lot of text right?
Is there any easier way? And if i have to code with HTMLBody, how to simplify it?
Thanks in advance.
I am trying to send a mail frm Access on a button click.
It works very well.
I am using the following code :
Dim SubjectLine As String
Dim strFilePath As String
Dim PersonSendTo As String
PersonSendTo = "info@info.com"
SubjectLine = "My Subject"
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = PersonSendTo
.Subject = SubjectLine
.Attachments.Add "attachemntfile.htm"
.Send
End With
The above code works fine. In the attachmentfile.htm (its a 2 page text) which i want to be displayed in the body of the mail and not as attachemnt. How to do it? I tried using HTMLBody, but that i need to type in lot of text right?
Is there any easier way? And if i have to code with HTMLBody, how to simplify it?
Thanks in advance.