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. Image for the cookie policy date

Duplicate text

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!



1 Reply

JJ Jisha Joy Syncfusion Team December 3, 2007 02:00 PM UTC

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}my text {placeholder}");
// section.AddParagraph().AppendText("my text {placeholder}");

//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



Loader.
Live Chat Icon For mobile
Up arrow icon