My aim is to insert text without usinge text references, for example I want to write 2 lines from code with documentbuilder and, after these, open an external doc file and add its contents and ,finally, add a new (or more) line from code.
I want to mix text from code or from file sequentially.
Thank you.
Stefano.
Document doc = new Document();
Document srcDoc = new Document(@"409_105975_ste\in2.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Some text before document");
InsertDocument(builder.CurrentParagraph, srcDoc);
builder.MoveToDocumentEnd(); //I think that you missed this line
builder.Write("Some text after document");
doc.Save(@"409_105975_ste\out.doc");
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.