Send object method and html

gsrajan

Registered User.
Local time
Today, 17:35
Joined
Apr 22, 2014
Messages
227
Can I use html to format the message body in send object method ? If I can, please let me know how to do that.

Thanks for your help.
 
You will have to use Outlook Automation to take advantage of .HTMLBody property. For example:
Dim olApp As Object
Dim olMail As Object

Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)

With olMail
.To = "toaddress@company.com
.Subject = "Subject Line"
.HTMLBody = "<p>This is the first line.</p><p>This is the second line.</p>"
.Display
End With

Set olMail = Nothing
Set olApp = Nothing
(untested)
Hope that helps...
 
Thank you, I have to paste a query result in the message body. I can do that in the send object method, but I wish to format the message body with colors and font sizes. Your answer helps me to format the mail body, but I can not paste the query in the message body with this html - because it does not recognize the variable which contain the query result.

Please help me to know how to this.

Thank you.
 
Normally this does with a text box using Rich Text Format.
 
Thanks Burrina,

Can you please give me the code for that or let me know how to do that.

Thanks
 
I don't have a clue how your db is setup so can't advise. Normally you use a ListBox that is filled with people to email to and have it populate other fields and then via code send the email, with/without attachments.
 

Users who are viewing this thread

Back
Top Bottom