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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Replacing Text string with html

Thread ID:

Created:

Updated:

Platform:

Replies:

131924 Aug 3,2017 01:14 PM UTC Aug 7,2017 09:14 AM UTC WinForms 3
loading
Tags: DocIO
Tom Bergman
Asked On August 3, 2017 01:14 PM UTC

I'm looking for the best way to replace text in a word doc with some HTML. For example, I have a Word doc with one or more instances of the text "InsertHtmlHere". I'd like to replace this with some HTML like "<b>Some Bolded Text</b>". 

The HTML will be more complex than this but this should give you the idea of what I'm trying to do.

Thanks

Mohanaselvam  Jothi [Syncfusion]
Replied On August 4, 2017 06:39 AM UTC

Hi Tom,

Thank you for using Syncfusion products.

Yes, you can use replace functionality in DocIO to replace text in a Word document. We have prepared a sample to illustrate how to replace text in Word document as per your requirement. The sample can be downloaded from following link.

Sample link: http://www.syncfusion.com/downloads/support/forum/131924/ze/GenerateWord_Windows-1725102197.zip

To know more about replacing functionality, please refer the below UG documentation link:
https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace#replacing-the-search-results

Please let us know if this sample fulfills your requirements.

Regards,
Mohanaselvam J
 


Tom Bergman
Replied On August 4, 2017 03:02 PM UTC

Thanks for this. Unfortunately, this doesn't do what I asked for. Perhaps I wasn't clear.Yes, the text is replaced but instead of seeing <b>Some Bolded Text</b> in the document, I want to see Some Bolded Text .




Ramanan  Hariharasubramanian [Syncfusion]
Replied On August 7, 2017 09:14 AM UTC

Hi Tom,

Thank you for using Syncfusion products.

Yes, you can
replace a text with html formatted text in a Word document using DocIO. We have prepared a sample to illustrate how to replace text with html formatted text in Word document as per your requirement. The sample can be downloaded from following link.

Sample link: http://www.syncfusion.com/downloads/support/forum/131924/ze/ReplaceString-254841725

Please let us know if this sample fulfills your requirements. 

Regards,
Ramanan H 
 


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.

Warning Icon 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.Close Icon

;