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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

NullReferenceException when trying to replace more then 10 chars

Thread ID:





119330 Jun 5,2015 06:03 PM UTC Jun 8,2015 06:06 AM UTC WinForms 2
Tags: DocIO
Mark Visschers
Asked On June 5, 2015 06:03 PM UTC

When I try to replace a string in a word document larger then 9 chars + closing char I assume,
I get, on closing the document, a NullReferenceException.

When replacing a string with 8 chars with a big string it doesnt give me this exception.

Is this normal and is there a way to work around this?

strToReplace = "ReplaceReplace" + (i).ToString(); // this gives me a problem
strToReplaceWith = "HelloWorldasodifhaldfihasdlifhaldigh" + (i).ToString(); //this doesnt
wordDoc.Replace(strToReplace, strToReplaceWith, true, true);


Attachment: SyncBigReplace_8e2c9e60.rar

Mark Visschers
Replied On June 6, 2015 10:58 AM UTC

For some reason, when I started the program this morning it magically worked...
If this changes and I can create it in a reproducible way ill update this thread.

Sivasubramani V [Syncfusion]
Replied On June 8, 2015 06:06 AM UTC

Hi Mark,
Thank you for using Syncfusion products.
We will wait until we hear from you.
Please refer the below mentioned UG link for more details on find and replace technique in DocIO.

Please refer the below mentioned online sample link to know more usage on find and replace technique using DocIO.
Online sample link:

Please let us know if you have any questions.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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