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);
wordDoc.Save("ReplacedSample.docx");
wordDoc.Close();
Greetings
Attachment:
SyncBigReplace_8e2c9e60.rar