Inserting a Line Break Using ASCII Code

  • Thread starter David C. Holley
  • Start date
D

David C. Holley

What are the ASCII codes to insert a line break in to a string? I have a
document with a form field which will be set programmically to display
an address in

name
addressLine1
addressLine2
city, state zipCode

format.
 
D

Doug Robbins

mystr = Name & vbCr & addressLine1 & vbCr & addressLine2 & vbCr & city & ",
& state zipCode

That assumes that Name, addressLine1, addressLine2, etc are variables

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

David C. Holley

I'm trying to put the string in a form field using...

..FormFields("AccountInformation").Result = getAccountNameForWord(9)

The vbCR is not being recognized nor is Chr(13).
 
D

Doug Robbins

Just as a test,

ActiveDocument.FormFields("Text2").result = "One" & vbCr & "Two"

run on exit from a formfield Text1, populated Text2 with:

One
Two

So, there must be something else wrong, not the vbCr.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

David C. Holley

No luck, plus the form field that I'm trying to set is the Address
Header for the invoice. The value that I'm puttin in there contains the
full address formated with all four or so lines. I may just go with 1
form field per line.
 

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