Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
John Nurick John Nurick is offline
external usenet poster
 
Posts: 7
Default DocVariable fields adjacent to end of cell marks display wrongly

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   Report Post  
Posted to microsoft.public.word.tables
Helmut Weber Helmut Weber is offline
external usenet poster
 
Posts: 139
Default DocVariable fields adjacent to end of cell marks display wrongly

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   Report Post  
Posted to microsoft.public.word.tables
John Nurick John Nurick is offline
external usenet poster
 
Posts: 7
Default DocVariable fields adjacent to end of cell marks display wrong

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   Report Post  
Posted to microsoft.public.word.tables
Helmut Weber Helmut Weber is offline
external usenet poster
 
Posts: 139
Default DocVariable fields adjacent to end of cell marks display wrong

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I set display color of formatting marks? Matthias Microsoft Word Help 6 January 22nd 07 03:25 PM
Supress blank lines Jan Mailmerge 5 March 6th 06 03:52 PM
Cell borders in a Table do not display on the monitor screen Bo_Jack Tables 1 March 5th 06 10:49 PM
paragraph marks don't display properly Xi Shi Microsoft Word Help 1 December 5th 05 03:27 AM
Fields only display the code not the data!! Paula Microsoft Word Help 3 September 13th 05 03:53 AM


All times are GMT +1. The time now is 12:58 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"