1,105,263 Community Members

VB Email Body Text

Member Avatar
mathbalaji
Newbie Poster
6 posts since Nov 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi All,

I just tried to write a code which, upon clicking on a button should send an email with attachment. I succeded by using some of the posts here, but however I need to add some special effects in between...

In the body of the email, I need to Bold and change 2 lines to blue.
Like this:

Username:

Password:

OutLookMail.Body = "Username: " & TxtUsername.Text & vbCrLf & "" & vbCrLf & "Password: " & TxtPassword.Text

How can I do that?!

Thanks!

Member Avatar
mathbalaji
Newbie Poster
6 posts since Nov 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Is it like we can only make "plain text" body? I tried using the and <b> tags... it's not working!

Member Avatar
cometburn
Junior Poster
122 posts since Feb 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

<strong>Try this</strong>

And pls let me know if it worked.

Member Avatar
debasisdas
Posting Genius
6,542 posts since Feb 2007
Reputation Points: 580 [?]
Q&As Helped to Solve: 476 [?]
Skill Endorsements: 25 [?]
Featured
 
0
 

try to use this

Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "myfriend@gmail.com  "
.Cc = "hisfriend@yahoo.com"
.Subject = "Hello Friends (one more time)..."
.Body = "This is the body of message"
.HTMLBody = "HTML version of message"
.Attachments.Add ("c:\myFileToSend.txt")
.Send      'send the mail
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Member Avatar
mathbalaji
Newbie Poster
6 posts since Nov 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks a lot... That worked.

Cometburn - Your suggestion did work, but after using hte previous code only! I didn't use the HTML body and that's why <b> and tags didn't work. Thanks a lot again! Have a great day!

Member Avatar
debasisdas
Posting Genius
6,542 posts since Feb 2007
Reputation Points: 580 [?]
Q&As Helped to Solve: 476 [?]
Skill Endorsements: 25 [?]
Featured
 
0
 

My pleasure .

Member Avatar
cometburn
Junior Poster
122 posts since Feb 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

Welcome!

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article