Lenny said:
Jean-Guy: In the VB editor, I tried breaking the line using both of the
examples you provided. Some additional info: The code is executed from a
dropdown inside a table cell as an exit macro. The select case line is
entered into a form field bookmarked as "Text 13" as referenced in the select
case code, into a different cell. Each one of the three items in the
dropdown, reference in the select case routing works great! It's just that
the Case TD item won't break, or wrap in the cell. Is the fact that the
receiving referenced cell is in a table cell the reason that it won't wrap?
I have used this same method in a legal letter that had very long lines and
it wrapped to the next line. But I have never tried to physically force the
line to break. I did press the 'enter' key after the underscore and let the
balance fall to the left margin, as well as tried indenting before the
amersand and the results keep appearing in the cell as one continuous line,
not two.... confused!
Case "TD"
oDoc.FormFields("Text13").Result = "TOOL DEVIATION - " _
& "Valid for listed E/N only."
Or:
Case "TD"
oDoc.FormFields("Text13").Result = _
"TOOL DEVIATION - " _
& "Valid for listed E/N only."
Ha, you mean that you want "TOOL DEVIATION - Valid for listed E/N only." to
wrap in the document, not in the code window.
If that is the case, then what I suggested will no help because I thought
you wanted to split the line in the Editor window on two lines...
Ok, let's start over...
When the text gets inserted in the document, if it is indeed inserted in a
text formfield (not a dropdown), it should wrap automatically, if it does not
you need to chek your document more carefully. Teh fact that it sits in a
cell is not relevant, unless of coursr, thee is enough space in the cell to
display thet ext on one line.
If you want to force a break, try this:
Case "TD"
oDoc.FormFields("Text13").Result = "TOOL DEVIATION - " _
& vbCrLf & "Valid for listed E/N only."
vbCrLf will insert a paragrpah mark "¶".
If you want a line break instead, try:
Case "TD"
oDoc.FormFields("Text13").Result = "TOOL DEVIATION - " _
& Chr(11) & "Valid for listed E/N only."