I have these lines of code to find and replace all in a doc using interop dll:
object replaceAll = Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll;
object findText = "";
object replaceText = "^&";
Microsoft.Office.Interop.Word.Find wf = doc.Content.Find;
wf.ClearFormatting();
wf.Font.Italic = 1;
wf.Replacement.ClearFormatting();
wf.Replacement.Font.Bold = 0;
wf.Text = "*";
wf.Execute(ref findText, ref noData, ref noData, ref noData, ref noData, ref noData, ref noData, ref noData, ref vTrue, ref replaceText, ref replaceAll, ref noData, ref noData, ref noData, ref noData);
Is this the replacement of the above code using aspose:
string findText = "";
string replaceText = "*^&*";
doc.Range.Replace(findText, replaceText, false, true);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Font.ClearFormatting();
builder.Font.Italic = true;
builder.Font.Bold = false;
builder.Write("*");
why two clearformating() method in the intrrop code ? I guess both are having the same functioanlity.
Thanks in advance.