Userform .htmlBody problem

Antonio12

Board Regular
Joined
Jul 11, 2012
Messages
73
Hello Everybody:

I have a problem with a userform text. The user completes the userform and clicks send. The email is sent and it arrives to email destination.

My problem is with the text. I have 3 textboxes 2 comboboxes. All I want is for the email to arrive with info separated by paragraphs and not spaces. This is what I have and I cant get this to work:


.HTMLBody = "Cliente: " & vbcrf & txtbox1 & " Contacto: " & vbcrf & txtbox2 & " Observações: " & vbcrf & txtbox4 & " Criado Para: " & vbcrf & Combobox1 & " Criado Por: " & vbcrf & Combobox2


Please HELP!!! I know it sounds idiotic for you guys with experience but I've been trying to get around it and it is impossible.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try using the following instead of vbcrf - remove the spaces, the board doesn't like html "< br / >"
 
Upvote 0
Thank you for the reply. I'm not sure if it just didn't work or if I didn't understand. Is this what you suggested:

.HTMLBody = "Cliente: " & txtbox1 & " Contacto: " & txtbox2 & " Observações: " & txtbox4 & " Criado Para: " & CB1 & " Criado Por: " & CB2
.Send

When I did this the email came blank. I Also tried:

.HTMLBody = "Cliente: " & txtbox1 & vbNewLine & " Contacto: " & txtbox2 & vbNewLine &" Observações: " & txtbox4 & vbNewLine & " Criado Para: " & CB1 & vbNewLine & " Criado Por: " & CB2
.Send


Didnt work either. Any suggestions?
 
Upvote 0
You aren't using any HTML code so use Body instead of HTMLBody.

Or use Kyle's suggestion.
 
Upvote 0
That should work. What does this return

MsgBox "Cliente: " & txtbox1 & vbNewLine & " Contacto: " & txtbox2 & vbNewLine &" Observações: " & txtbox4 & vbNewLine & " Criado Para: " & CB1 & vbNewLine & " Criado Por: " & CB2
 
Upvote 0
The following worked:

.Body = "Cliente: " & txtbox1 & vbNewLine & " Contacto: " & txtbox2 & vbNewLine & " Observações: " & txtbox4 & vbNewLine & " Criado Para: " & CB1 & vbNewLine & " Criado Por: " & CB2
.Send

Thank you so much guys!!!! :)
 
Upvote 0

Forum statistics

Threads
1,216,136
Messages
6,129,080
Members
449,485
Latest member
greggy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top