vbCr

L

Lee Kiwiflame

I want to insert an address into a DocVariable and have used the code:

ActiveDocument.Variables("address").Value = _
strAdd1 & vbCr & strAdd2 & vbCr & strAdd3

BUT when the letter is generated, I get the small square boxes inserted
where the paragraph breaks should be.

Please note that the strings have been set with:

strAdd1 = frmPoolAccts.TxtAdd1
strAdd2 = frmPoolAccts.TxtAdd2
strAdd3 = frmPoolAccts.TxtAdd3
 
K

Karl E. Peterson

Lee Kiwiflame said:
Sorry - I think what I am after is all the Chr() codes as well. I have just
recorded a SHIFT + ENTER and it is Chr(11). I'm not sure if this is the best
way to enter a soft return or not.

Sounds like a vbVerticalTab character, there.
 
H

Helmut Weber

Hi Lee,

see help for "Miscellaneous Constants"
type vbCr in the VBA-Editor, F11.

But there is a good deal of confusion in this,
not to say, some of the information is misleading,
if not just simply wrong, e.g.

quote
vbVerticalTab Chr(11) Not useful in Microsoft Windows [...]
unquote
Which is just nonsense.

quote
vbLf Chr(10) Linefeed character
unquote

Which does work in Excel as expected,
but not in Word.

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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