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
close icon

Search/Replace changes fonts/ styling

I am evaluating DocIO from Essential Studio 5.1.0.51 under ASP.NET 2.0, and have noticed that when doing search/replace, the fonts for the entire document are changed.
Basically, what I do is read a document from a template, then perform a search/replace on all text enclosed in << >> characters.
The method that does this is shown below:
private static void DoReplacements(WordDocument templateDoc, string[] findMatches, string[] replaceValues)
{
if (findMatches.Length != replaceValues.Length)
{
throw new ApplicationException("replacement string and value arrays have different lengths");
}
for (int i = 0; i < findMatches.Length; i++)
{
templateDoc.Replace(findMatches[i], replaceValues[i], false, false);
}
}

Attached is the template document and the saved document - you can see that the font has changed to Arial followed by a strange character, and the bullets in the body of the document have become squares

2 Replies

MB Mark Bagnall August 15, 2007 04:38 PM UTC

NB - This also happens with the sample code when run from my machine.


J. J.Nagarajan Syncfusion Team August 21, 2007 12:31 AM UTC

Hi Mark,

Since the template document that you have mentioned in your update is missing. I have tested this issue in v.5.1.0.51 with the Find and Replace sample that comes along with our install. The sample can be found at the following path.

My Documents\Syncfusion\EssentialStudio\5.1.0.51\Web\docio.web\Samples\2.0\Find And Replace\FindAndReplace

Here is my test results. The font used in the template file is preserved after replace operation done using DocIO and I am unable to reproduce this issue reported to us. Could you please let me know if you are able to reproduce this issue with this sample. If not could you provide with the template document, sample that you have used to reproduce this issue.

Kindly provide us the details. It would help us to investigate on this issue.

Regards,
Nagaraj

Loader.
Live Chat Icon For mobile
Up arrow icon