send record via HTML EMail

B

Bill

OK. With help, I was able to get access to send an HTML email. Now I just
need to get the record to be passed. What values or inserts do I put in? I
know this is probably VERY simply
but I lost :) Thx
 
D

Daniel Pineault

in your sub/function... you need to reference the various control on your
form to pull/push their values to build your HTML string.

For instance, if your have a textbox named "FirstName" and another named
"LastName" you would code it something like:

strHTML = Me.FirstName & " " & Me.LastName

Your can concatenate in the manner all your controls and build your HTML
message and create the layout you wish using HTML tags.
--
Hope this helps,

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

Bill

Exactly. but... sorry for being such a beginner on this...

If I want to bold the "FirstName" via HTML, how would I do this?

Thx for the help
 
B

Bill

This is what I have so far. How/where can I put the tags??:

Private Sub Command125_Click()
'Creates a new e-mail item and modifies its properties.

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY>Enter the message text here. & Me.[Check-out
Date] </BODY></HTML>"
.Display
End With

End Sub
 
D

Daniel Pineault

Bill then you use HTML tags to do your formatting.

For instance, if you want to bold your text you need to place it in between
bold tags
"<b>" & Me.FirstName & "</b>"

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.com/index.php
Please rate this post using the vote buttons if it was helpful.



Bill said:
This is what I have so far. How/where can I put the tags??:

Private Sub Command125_Click()
'Creates a new e-mail item and modifies its properties.

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY>Enter the message text here. & Me.[Check-out
Date] </BODY></HTML>"
.Display
End With

End Sub

Daniel Pineault said:
in your sub/function... you need to reference the various control on your
form to pull/push their values to build your HTML string.

For instance, if your have a textbox named "FirstName" and another named
"LastName" you would code it something like:

strHTML = Me.FirstName & " " & Me.LastName

Your can concatenate in the manner all your controls and build your HTML
message and create the layout you wish using HTML tags.
--
Hope this helps,

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

Bill

Thank you. I figured it out late last night. Don't know why, but it just
wasn't catching. Maybe to many beers or not enough! Thanks for your help.
Bill

Daniel Pineault said:
Bill then you use HTML tags to do your formatting.

For instance, if you want to bold your text you need to place it in between
bold tags
"<b>" & Me.FirstName & "</b>"

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.com/index.php
Please rate this post using the vote buttons if it was helpful.



Bill said:
This is what I have so far. How/where can I put the tags??:

Private Sub Command125_Click()
'Creates a new e-mail item and modifies its properties.

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY>Enter the message text here. & Me.[Check-out
Date] </BODY></HTML>"
.Display
End With

End Sub

Daniel Pineault said:
in your sub/function... you need to reference the various control on your
form to pull/push their values to build your HTML string.

For instance, if your have a textbox named "FirstName" and another named
"LastName" you would code it something like:

strHTML = Me.FirstName & " " & Me.LastName

Your can concatenate in the manner all your controls and build your HTML
message and create the layout you wish using HTML tags.
--
Hope this helps,

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



:

OK. With help, I was able to get access to send an HTML email. Now I just
need to get the record to be passed. What values or inserts do I put in? I
know this is probably VERY simply
but I lost :) Thx
 
M

MR C

Hi All,

This all makes sense to me and is the answer to my problem, but......

It took me ages to realise that i have to include a reference to the Outlook
11.0 Object library. But were the hell is the Outlook Application object!
When I try and run the code I get error 429 can't create object (with the
error highlighted around the line of code that creates the new mail item
MailItem).
The object browser does now show a reference to MailItem but none for the
elusive Outlook Object.

I tried a similar piece of code, i.e. opening up a new Access Db or an
existing Db and this works fine.

Tried you code and keep getting error

Daniel Pineault said:
Bill then you use HTML tags to do your formatting.

For instance, if you want to bold your text you need to place it in between
bold tags
"<b>" & Me.FirstName & "</b>"

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.com/index.php
Please rate this post using the vote buttons if it was helpful.



Bill said:
This is what I have so far. How/where can I put the tags??:

Private Sub Command125_Click()
'Creates a new e-mail item and modifies its properties.

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY>Enter the message text here. & Me.[Check-out
Date] </BODY></HTML>"
.Display
End With

End Sub

Daniel Pineault said:
in your sub/function... you need to reference the various control on your
form to pull/push their values to build your HTML string.

For instance, if your have a textbox named "FirstName" and another named
"LastName" you would code it something like:

strHTML = Me.FirstName & " " & Me.LastName

Your can concatenate in the manner all your controls and build your HTML
message and create the layout you wish using HTML tags.
--
Hope this helps,

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



:

OK. With help, I was able to get access to send an HTML email. Now I just
need to get the record to be passed. What values or inserts do I put in? I
know this is probably VERY simply
but I lost :) Thx
 
M

MR C

Hello Again,

I don't believe it!. Just tried the code again and it works!

Early days yet though.

No doubt I'll be back!

MR C said:
Hi All,

This all makes sense to me and is the answer to my problem, but......

It took me ages to realise that i have to include a reference to the Outlook
11.0 Object library. But were the hell is the Outlook Application object!
When I try and run the code I get error 429 can't create object (with the
error highlighted around the line of code that creates the new mail item
MailItem).
The object browser does now show a reference to MailItem but none for the
elusive Outlook Object.

I tried a similar piece of code, i.e. opening up a new Access Db or an
existing Db and this works fine.

Tried you code and keep getting error

Daniel Pineault said:
Bill then you use HTML tags to do your formatting.

For instance, if you want to bold your text you need to place it in between
bold tags
"<b>" & Me.FirstName & "</b>"

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.com/index.php
Please rate this post using the vote buttons if it was helpful.



Bill said:
This is what I have so far. How/where can I put the tags??:

Private Sub Command125_Click()
'Creates a new e-mail item and modifies its properties.

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY>Enter the message text here. & Me.[Check-out
Date] </BODY></HTML>"
.Display
End With

End Sub

:

in your sub/function... you need to reference the various control on your
form to pull/push their values to build your HTML string.

For instance, if your have a textbox named "FirstName" and another named
"LastName" you would code it something like:

strHTML = Me.FirstName & " " & Me.LastName

Your can concatenate in the manner all your controls and build your HTML
message and create the layout you wish using HTML tags.
--
Hope this helps,

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



:

OK. With help, I was able to get access to send an HTML email. Now I just
need to get the record to be passed. What values or inserts do I put in? I
know this is probably VERY simply
but I lost :) Thx
 

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