...

View Full Version : Line break (newline) in MS-Word



muneeba9071
05-20-2011, 05:13 PM
Hi,

I am using phpWord (http://phpword.codeplex.com/) to generate word documents, the only problem is I dont know how to add a line break, does anyone know what is the character for line break, so for example I have the following text:


This is
a
Test Text


Now if I enter that into the word document, this is what I get in the word document:


This is a Test Text

I really am after a character that I can use that will generate a new line, please note I have tried all of the following characters and they don't work

\n
\r\n
\n\r
\v


Would really appreciate if some one could help.

Thanks

angst
05-21-2011, 12:12 AM
according to the manual "Calling the addText() function will always create a line break. This happens because the DOCX Writer creates a paragraph for each text element."

muneeba9071
05-21-2011, 06:08 PM
Yes I know that but the problem is I am using a template. and I must use the setText method. Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum