Free Support Forum - aspose.com

Writing in to Aspose Doc

I have a string as given below:

NIKHIL400 52 25 kumar Y N 534111 54 P XXXX #3,BASTERS STREET MASTERS LANE LONDON UK 31-MAY-2011 336772 215245 CHARLES DARWIN 10-MAY-2011 50-MAY-2 ENGINEER SOCIETY LONDON

How can i write this string to a aspose word document?

Hello.


Thanks for your request. As a very simple way, you can try using the following code:

//Create document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

//Read your string from file
using (System.IO.StreamReader reader = new StreamReader(@“text.txt”))
{
res = reader.ReadToEnd();
}

//write string to Document
builder.Write(res);

//Save Document
doc.Save(“out.doc”, SaveFormat.Doc);

Best regards,

what is this “res” for?

Thanks for your request. ‘res’ is a string.


Best regards,