ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   text wrapping in coding lines (https://www.excelbanter.com/excel-programming/431207-text-wrapping-coding-lines.html)

gab1972

text wrapping in coding lines
 
I prompting the start of an email through VBA and I have a few canned
paragraphs to write in the body of the email. I'm typing all of this
in the coding lines in VBA and I don't want the lines to go
waaaaaaaaayyyy to the right in my coding lines. How do I wrap the
text to the next line and continue typing so it is all one line?

olMyEmail.Body = "Attached is a permit application package
including_
instrutions and copies of the Design
Exception form_
(if needed) and the permit
application forms."

This does not work...any suggestions?

gab1972

text wrapping in coding lines
 
On Jul 16, 9:57*am, gab1972 wrote:
I prompting the start of an email through VBA and I have a few canned
paragraphs to write in the body of the email. *I'm typing all of this
in the coding lines in VBA and I don't want the lines to go
waaaaaaaaayyyy to the right in my coding lines. *How do I wrap the
text to the next line and continue typing so it is all one line?

* * olMyEmail.Body = "Attached is a permit application package
including_
* * * * * * * * * * * * * * * * *instrutions and copies of the Design
Exception form_
* * * * * * * * * * * * * * * * *(if needed) and the permit
application forms."

This does not work...any suggestions?


Nevermind....once again...I figured out my own answer. I really need
to start thinking just a bit more before I post. Sorry for the
clutter.

"Attached is a permit application package " & _
"including instructions and copies of the " & _
etc., etc.

Rick Rothstein

text wrapping in coding lines
 
You must break your long lines into separate sub-strings and then
concatenate them. For example, this line ...

L = "Pretend this is a very long line of code that you want to break apart"

becomes this...

L = "Pretend this is a very long " & _
"line of code that you want to " & _
"break apart"

And don't forget to keep the blank space at any "break points" attached to
one of the substrings that you have formed.

--
Rick (MVP - Excel)


"gab1972" wrote in message
...
I prompting the start of an email through VBA and I have a few canned
paragraphs to write in the body of the email. I'm typing all of this
in the coding lines in VBA and I don't want the lines to go
waaaaaaaaayyyy to the right in my coding lines. How do I wrap the
text to the next line and continue typing so it is all one line?

olMyEmail.Body = "Attached is a permit application package
including_
instrutions and copies of the Design
Exception form_
(if needed) and the permit
application forms."

This does not work...any suggestions?




All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com