Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Inserting a Line Break Using ASCII Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David C. Holley - 09 Aug 2005 17:59 GMT
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.
Doug Robbins - 09 Aug 2005 18:37 GMT
mystr = Name & vbCr & addressLine1 & vbCr & addressLine2 & vbCr & city & ",
& state zipCode

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

Signature

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

> 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
[quoted text clipped - 6 lines]
>
> format.
David C. Holley - 09 Aug 2005 20:01 GMT
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).

> mystr = Name & vbCr & addressLine1 & vbCr & addressLine2 & vbCr & city & ",
> & state zipCode
>
> That assumes that Name, addressLine1, addressLine2, etc are variables
Doug Robbins - 10 Aug 2005 05:30 GMT
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.

Signature

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

> I'm trying to put the string in a form field using...
>
[quoted text clipped - 6 lines]
>>
>> That assumes that Name, addressLine1, addressLine2, etc are variables
David C. Holley - 10 Aug 2005 16:07 GMT
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.

> Just as a test,
>
[quoted text clipped - 6 lines]
>
> So, there must be something else wrong, not the vbCr.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.