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.

Insert the hole content of a document into another document find/replace

Thread ID:

Created:

Updated:

Platform:

Replies:

70419 Dec 11,2007 04:31 AM Dec 12,2007 05:56 AM ASP.NET Web Forms (Classic) 1
loading
Tags: DocIO
Josue Medrano
Asked On December 11, 2007 04:31 AM

Hi,

Is it possible to replace a placeholder with the hole content of another document.
in other words marge a word ducument into other in a desired place.

Thanks for your information.
Joshua



Bhuvaneswari P [Syncfusion]
Replied On December 12, 2007 05:56 AM

Hi Joshua,

Thanks for evaluating Syncfusion products.
Is it possible to replace a placeholder with the hole content of another document.in other words marge a word ducument into other in a desired place.?

Yes, it is possible to find the particular text in source document and replace it with the content of another whole document using TextBodyPart. You need to select the whole document using the tectBodySelection, then copy the selected text into the TextBodyPart.

The following code snippet illustrates this..

//Select text and image
TextBodyPart replacePart = new TextBodyPart(replaceDoc);

//Select the whole document
TextBodySelection textSel = new TextBodySelection(replaceDoc.LastSection.Body, 0, replaceDoc.LastSection.Paragraphs.Count,0,1);

//Copy the selected area into the TextBodyPart
replacePart.Copy(textSel);

//Replace Text with image and text.
doc.Replace("INSERT PARAGRAPH ITEMS", replacePart, false, true);

Please downlaod the sample from the below link which demonstrate the above concept
http://websamples.syncfusion.com/samples/DocIO.Windows/F70419/main.htm

Please take a look into the sample and let me know if this helps you.

Best Regards,
Bhuvana



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.

;