JimG
New Member
- Outlook version
- Outlook 2013 64 bit
- Email Account
- Exchange Server
Hi. I've been experimenting with VBA for Outlook 2013. When I use my HTML in an Outlook HTML email message, it strips most of my styles from the <style> tag. I have my styles inline also, but when Outlook strips my <style> tag, it also removes my @media queries. A large percentage of my end-users will read my email using an iPhone, so I'd like to take advantage of @media. I'm forced to use Outlook 2013 to send the message by my employer.
With the VBA script below, I'm trying to replace the default <style> tag in Outlook HTML email with my own. Does anyone know if this can be done, or what may be wrong with my code below?
Public Sub routine()
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = myRegExp.Replace("[<style.*</style>]", "[>table.MsoNormalTable {font-size:1.5em;font-family:Arial,sans-serif;}div.MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:1.5em;font-family:Arial,sans-serif;}.jim {font-size:5em;}@media only screen and (max-width:580){table.MsoNormalTable{font-size:3em;font-family:Arial,sans-serif;}}</style>")
End Sub
Thanks for any advice,
Jim
With the VBA script below, I'm trying to replace the default <style> tag in Outlook HTML email with my own. Does anyone know if this can be done, or what may be wrong with my code below?
Public Sub routine()
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = myRegExp.Replace("[<style.*</style>]", "[>table.MsoNormalTable {font-size:1.5em;font-family:Arial,sans-serif;}div.MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:1.5em;font-family:Arial,sans-serif;}.jim {font-size:5em;}@media only screen and (max-width:580){table.MsoNormalTable{font-size:3em;font-family:Arial,sans-serif;}}</style>")
End Sub
Thanks for any advice,
Jim