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.

Read and replace entire text contents of Word Document

Thread ID:

Created:

Updated:

Platform:

Replies:

131805 Jul 27,2017 02:51 PM Jul 28,2017 08:46 AM ASP.NET MVC 1
loading
Tags: DocIO
Philip Tenn
Asked On July 27, 2017 02:51 PM

Hi All,

I am looking to translate an English Word Document to Spanish.

Basically, I need to read the entire text contents, translate, and replace entire text contents.

I know I can read the text with WordDocument.GetText.

How can I write it back?  Also, is there a way to preserve formatting?

Thanks,

Philip

Devisri Jothi [Syncfusion]
Replied On July 28, 2017 08:46 AM

Hi Philip, 
Thank you for contacting Syncfusion support. 
Yes, we can get the text using WordDocument.GetText(), however, the formatting of the content will be eventually lost on replacing the text. We have created a sample to meet your requirement. The sample demonstrates how to retrieve multiple text range in a paragraph and replace with the desired text. You may download the sample from the below link, 
Sample 
Output 
The generated document will be located in the output folder of the provided sample. 
Please let us know if you need any further assistance. 
Regards, 
Devisri

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.

;