outlook email body formatting issues from excel vba

M

mr rapidan

Hi, my name's Kyle.

I'm sending email from Excel VBA for the first time. I've got
everything working just fine and dandy - emails are going where I want
them, with attachments when I want them, but the formatted text
strings (multiple lines of dates, numbers, and text) that I want in
the email body are getting screwed up.

I need a fixed space font to get things lined up.

First, when I was just using .body, the text was showing up in the
resulting email in a proportional font.

So, I figured out that .htmlbody was the way to go, but I'm flailing
around - I've managed to specify a fixed space font, but the spaces
are getting stripped out of my formatted text strings! Is there a way
to prevent my spaces from getting stripped out?

Can someone please help!?

Kyle
Lehigh Valley, PA
 
M

mr rapidan

Hi, my name's Kyle.

I'm sending email from Excel VBA for the first time.  I've got
everything working just fine and dandy - emails are going where I want
them, with attachments when I want them, but the formatted text
strings (multiple lines of dates, numbers, and text) that I want in
the email body are getting screwed up.

I need a fixed space font to get things lined up.

First, when I was just using .body, the text was showing up in the
resulting email in a proportional font.

So, I figured out that .htmlbody was the way to go, but I'm flailing
around - I've managed to specify a fixed space font, but the spaces
are getting stripped out of my formatted text strings!  Is there a way
to prevent my spaces from getting stripped out?

Can someone please help!?

Kyle
Lehigh Valley, PA

Solved my own problem.

Used Dick's Clicks RangeToHTML function to put the range I was trying
to email into HTML, and sent that in .htmlbody.

I don't understand what's happening, at all, but it works, and that's
what counts at this point in the evening!
 

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