Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 9.0 Object Library "Forcing a new line in Word"

Status
Not open for further replies.

kfoxNevada

Programmer
Sep 22, 2003
7
US
I'm trying to force a new line in a .Formfields result (in a Word document) using the following:
---------------------------------------------
.FormFields("fldSub1a").Result = rst!CAS_Number & Chr(10)
---------------------------------------------
I've tried Chr(13) and Chr(10) & Chr(13) together. Sometimes it works, sometimes it doesn't. Any ideas?
 
You might be able to use the vbNewLine constant value?

PeteJ
(Contract Code-monkey)

It's amazing how many ways there are to skin a cat
(apologies to the veggies)
 
My formfield in Word did not care for vbNewLine (which is probably a Chr(13). Anyway, I found CHR(11) which is a vertical tab. This seems to work-- so far.

Thanks for your input.
 
I would use:
.FormFields("fldSub1a").Result = rst!CAS_Number & vbCrLf & ""

hth

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top