Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
G'day all,
I'm setting up a contract template and using document variables to capture (via a UserForm) and store various names, addresses, etc. that appear at different places in the document. When I put a multi-line string into a document variable (e.g. "27 Acacia Avenue" & vbCr & "Croydon CR99 9XX" & vbCr & "United Kingdom") and display it with a DOCVARIABLE field in a table cell, the field value displays on a single line with 'little square boxes' where the paragraph breaks should be. So far the only way I can stop this is to put a paragraph mark between the field and the end-of-cell marker, which of course creates a blank line which spoils the layout. Any solutions? (BTW, using CR+LF instead of just CR doesn't solve the single-line problem, just adds to the number of 'little square boxes'.) -- John Nurick Microsoft Access MVP |
#2
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
Hi John,
if it is about lines, not paragraphs, use chr(11). HTH -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#3
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
Thanks, Helmut.
I've revised my code that collects the values from the textboxes on the UserForm and assigns them to the docvariables so it changes vbCrLf to Chr(11) rather than vbCr, and the multi-line values are now behaving properly. Interestingly, when I assign the contents of a docvariable to a textbox on the form, e.g. With ActiveDocument.Variables ... Me.txtInvoiceAddress.Value = .Item("InvoiceAddress").Value ... End With Chr(11) in the docvariable seems to be translated to vbCrLF in textbox.Value. -- John Nurick Microsoft Access MVP "Helmut Weber" wrote: Hi John, if it is about lines, not paragraphs, use chr(11). HTH |
#4
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
Hi John,
IMHO, strictly speaking, chr(11) is not converted to vbCrLf, but to chr(13). There is a good deal of confusion in this. See help for vbCrLF "Miscellaneous constants" and disregard most of what is to be read there. Have a nice day. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I set display color of formatting marks? | Microsoft Word Help | |||
Supress blank lines | Mailmerge | |||
Cell borders in a Table do not display on the monitor screen | Tables | |||
paragraph marks don't display properly | Microsoft Word Help | |||
Fields only display the code not the data!! | Microsoft Word Help |