Question abt Arvin Meyer's code to send e-mail from access!

  • Thread starter Earl.AKA J.Alladien in access forum!!
  • Start date
E

Earl.AKA J.Alladien in access forum!!

Hi All,

I think most of you are formilliar with Arvin's code which is:

'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = Forms![Names1]![E-mail Address]
.Subject = Forms![Names1]![SUB]
.Body = Forms![Names1]![Body]
.SEND
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

I was wondering if it's possible in abovementioned code to format the text
for the BODY in differant colours,Partially in differant colours and or make
some words Bigger then the rest of the text, you know like when you compose a
new mail-message you can do to the Text whatever you like!

Is this possible?Thanks in advance for the help!
 
D

Daniel Pineault

Arvin's code used Outlook Automation. As such, you can pretty much do
anything you can normally do in Outlook. What you are talking about doing
requires using HTML format in your e-mail. Therefore you need to change the
..Body to .HTMLBody and then use standard HTML tag to define the look/feel you
wish to create for your e-mail.

See

http://www.microsoft.com/office/com...&p=1&tid=511eb96c-6b4e-4f58-83b9-f0223b5776b8
(another post on the subject with a few links)

Check out the following site for more info on HTML tags.
http://www.w3schools.com/html/html_formatting.asp
http://www.w3schools.com/html/html_primary.asp

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
E

Earl.AKA J.Alladien in access forum!!

Thank you Daniel,

That did it!!

Daniel Pineault said:
Arvin's code used Outlook Automation. As such, you can pretty much do
anything you can normally do in Outlook. What you are talking about doing
requires using HTML format in your e-mail. Therefore you need to change the
.Body to .HTMLBody and then use standard HTML tag to define the look/feel you
wish to create for your e-mail.

See

http://www.microsoft.com/office/com...&p=1&tid=511eb96c-6b4e-4f58-83b9-f0223b5776b8
(another post on the subject with a few links)

Check out the following site for more info on HTML tags.
http://www.w3schools.com/html/html_formatting.asp
http://www.w3schools.com/html/html_primary.asp

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



Earl.AKA J.Alladien in access forum!! said:
Hi All,

I think most of you are formilliar with Arvin's code which is:

'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = Forms![Names1]![E-mail Address]
.Subject = Forms![Names1]![SUB]
.Body = Forms![Names1]![Body]
.SEND
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

I was wondering if it's possible in abovementioned code to format the text
for the BODY in differant colours,Partially in differant colours and or make
some words Bigger then the rest of the text, you know like when you compose a
new mail-message you can do to the Text whatever you like!

Is this possible?Thanks in advance for the help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top