Can't Contenate

R

ryguy7272

From Ron de Bruin's site:
http://www.rondebruin.nl/mail/folder2/files.htm

I tried the following piece of code:
With OutMail
.To = cell.Value
.Subject = "Weekly Forecasting"
.Body = "Hi " & cell.Offset(0, -1).Value & "Please view the
_ attachment for this week's forecasting."

The part after .Value gets truncated. Not sure why though. I tried to put
quotes around the whole body, but Excel wouldn't allow that (text turned
red). Any ideas as to what I am doing wrong?

Thanks,
Ryan---
 
J

Jim Thomlinson

Hard to tell with the wrapping that is going on but probably this...

..Body = "Hi " & cell.Offset(0, -1).Value & "Please view the " & _
"attachment for this week's forecasting."

You have to close off the text string and add the & before adding the line
connector.
 
O

OssieMac

.Body = "Hi " & cell.Offset(0, -1).Value & "Please view the _
attachment for this week's forecasting."

You cannot use a space and underscore to break a line of code in the middle
of text enclosed in double quotes. If you want to use a line break, insert it
in a section of the line that is not enclosed in double quotes.

..Body = "Hi " & cell.Offset(0, -1).Value & _
"Please view the attachment for this week's forecasting."
 

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