Free Support Forum - aspose.com

Add new line in form field

Hello,
I am working on form fields in a word document. I need to put new line in the address form field.

Sample:
Address form field = 83 All Saints Road Peterborough UK
would like to display this as

83,
All Saints Road,
Peterborough
UK


Cant get any helpful link on the web for this.

Thanks.

Hi,


Thanks for your inquiry. Sure, you can put new lines in ADDRESSBLOCK form field as follows:

Document doc = new
Document();

DocumentBuilder builder = new DocumentBuilder(doc);

Field addressField = builder.InsertField(@"ADDRESSBLOCK \* MERGEFORMAT",

"83," + ControlChar.LineBreak +

"All Saints Road," + ControlChar.LineBreak +

"Peterborough" + ControlChar.LineBreak +

"UK");

doc.Save(@"C:\Temp\out.docx");


I hope, this helps.

Best regards,