I have an ASP .Net Core 5 Web API, in which I am trying to do a Find and Replace on a Word document.
I'm using SyncFusion.EJ2.WordEditor.AspNet.Core 19.1.0.59
This is the code I am trying to implement:
using Syncfusion.EJ2.DocumentEditor;
using (WordDocument document = new WordDocument())
{
Stream docStream = File.OpenRead(Path.GetFullPath(@"../../../Template.docx"));
document.Open(docStream, FormatType.Docx);
docStream.Dispose();
document.Replace("Cyles", "Cycles", true, true);
docStream = File.Create(Path.GetFullPath(@"Result.docx"));
doument.Save(docStream, FormatType.Docx);
docStream.Dispose();
}
However, the "document" object (i.e. the instance of WordDocument) does not have a "Replace" method. In fact, it appears to have no methods at all. In Visual Studio 2019, if I type "document" and press fullstop on the keyboard, and the list of Intellisense suggestions comes up, there is only the stock "Dispose", "Equals", "GetHashCode", "GetObjectData", "GetType", and "ToString".
I'm not sure what I am doing wrong. I would greatly appreciate any suggestions..
Thank you.