We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Duplicate text

Thread ID:

Created:

Updated:

Platform:

Replies:

70193 Nov 30,2007 10:47 AM Dec 3,2007 09:00 AM Windows Forms 1
loading
Tags: DocIO
Oleg Covic
Asked On November 30, 2007 10:47 AM

Hello.
I'm new with DocIo.
I want to dublicate the text from one document

for example :
iniatal
my text {placeholder}
my text1 {placeholder}

after
my text {placeholder}
my text1 {placeholder}
my text {placeholder}
my text1 {placeholder}


How could I do this ?
Thanks in advance!



Jisha Joy [Syncfusion]
Replied On December 3, 2007 09:00 AM

Hi Oleg,

Thank you for your interest in Syncfusion Products.
This can be achieved by cloning the Paragraph and insert the cloned paragraph at the end of the paragraph.
Here is the code snippets:


//A new document is created.
WordDocument document = new WordDocument();
//Add a new section to the document.
IWSection section = document.AddSection();

//Adding a new paragraph to the section.
IWParagraph paragraph = section.AddParagraph();

paragraph.AppendText("my text {placeholder}\nmy text {placeholder}");
// section.AddParagraph().AppendText("my text {placeholder}\n");

//Clone the particular paragraph:
Entity par = section.Paragraphs[0].Clone();

//Insert the paragraph0
section.Paragraphs.Insert(1, par as IWParagraph);


Please refer the sample in the following link to illustrate this:
http://websamples.syncfusion.com/samples/DocIO.Windows/70193/main.htm

Please try this and let me know if you have any questions.
Regards,
Jisha



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;