Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Can't Contenate

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---

--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Can't Contenate

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.
--
HTH...

Jim Thomlinson


"ryguy7272" wrote:

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---

--
RyGuy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Can't Contenate


.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."

--
Regards,

OssieMac


"ryguy7272" wrote:

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---

--
RyGuy

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Can't Contenate

Damn space!! Both worked!!
Thanks guys,
Ryan--
--
RyGuy


"OssieMac" wrote:


.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."

--
Regards,

OssieMac


"ryguy7272" wrote:

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---

--
RyGuy

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"