Im trying to replace this superscript with a text but when i tried i get an error of property or indexers 'Microsoft.Office.Interop.Word.Find.Replacement' cannot be assigned to - -it is read only
. Sorry im just new in processing word docs.
wordDoc.ActiveWindow.Selection.Find.Font.Superscript = -1;
object forward = true;
object wrap = WdFindWrap.wdFindStop;
object format = true;
object matchCase = false;
object matchWholeWord = false;
object matchWildcards = false;
object matchSoundsLike = false;
object matchAllWordForms = false;
// Search all numeric superscripts
while (wordDoc.ActiveWindow.Selection.Find.Execute(ref missing, ref matchCase, ref matchWholeWord, ref matchWildcards, ref matchSoundsLike, ref matchAllWordForms, ref forward, ref wrap, ref format, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing))
{
// Look for Numbered References
if (Regex.IsMatch((wordDoc.ActiveWindow.Selection.Text).Trim(), @"^(\d+|\d+.?\d+?)$"))
{
object reference = wordDoc.ActiveWindow.Selection.Range;
string refNo = Regex.Match((wordDoc.ActiveWindow.Selection.Text).Trim(), @"^(\d+|\d+.?\d+?)$").Value.ToString();
MessageBox.Show(refNo);
object replaceAll = Word.WdReplace.wdReplaceOne;
wordDoc.ActiveWindow.Selection.Find.Text = refNo;
wordDoc.ActiveWindow.Selection.Find.ClearFormatting();
wordDoc.ActiveWindow.Selection.Find.Replacement = "Here";