VBA Coding (1 Viewer)

kasper5023

Registered User.
Local time
Today, 11:23
Joined
Aug 31, 2016
Messages
17
Access World,
I have been working on some code that I can't seem to figure out. I need to have text indented and in red font. This is part of an auto-email message through a form control.
"Complete Status = No Action Required, Product has been associated per your request.</P></h5><br/>" & _
"Cancelled Status = Additional Information Required, Product SDS could not be located (see attachment for comment). </P></h5><br/>" & _
 

plog

Banishment Pending
Local time
Today, 11:23
Joined
May 11, 2011
Messages
11,669
Technically this is an HTML issue, not VBA. HTML generally requires opening and closing tags, you have nothing but closing tags in your string. When you put a slash / in front of your html code that makes it a closing tag. So remove the slash from the first set of html codes you have put in and it should work.

Actually, if you don't have a css file that defines your h5 it won't be red nor indented. In that case you will have to apply the style inline on the h5 via a style attribute (http://www.w3schools.com/html/html_css.asp).
 

plog

Banishment Pending
Local time
Today, 11:23
Joined
May 11, 2011
Messages
11,669
I see now that this is going into email, that means you cannot have a css file. Which means you will need to add that style attribute. Here's an extra hint after you check out that link, in your style attribute you will need to set the color and padding to achieve what you want.
 

kasper5023

Registered User.
Local time
Today, 11:23
Joined
Aug 31, 2016
Messages
17
The padding did not work in the code. I must be misunderstanding your recommendation
 

plog

Banishment Pending
Local time
Today, 11:23
Joined
May 11, 2011
Messages
11,669
What's your code? Also, you can use margin instead of padding sometimes

margin-left: 20px;

When I do stuff like this, I first write the HTML in an html page (test.html), open it in a browser and debug it that way--just keep hitting refresh after you update/save the .html file. Makes it easier than executing your VBA everytime, waiting for the email and checking it.
 

Users who are viewing this thread

Top Bottom