Hi,
I am trying convert numeric values from the word document into superscript using C# and Spire. It is working for some instances but then some unwanted HTML like data is generating before the values, as below.
inleishmaniasis ADDINEN.CITE<EndNote><Cite><Author>Martori</Author><Year>2021</Year><RecNum>23</RecNum><DisplayText>[9].
Here is how the actual data in the document looks like,
thus Vitamin D can have an appropriate effect inleishmaniasis (9).
I tried below steps as I found on internet but no still luck!
Word 2007: Choose Office button (top left) > Word Options (bottom).
Word 2010/2013/2016: Choose File > Options.
Choose Advanced (left menu) and scroll down to the section titled "Show Document Content."
Uncheck the item titled "Show field codes instead of their values" and click OK.
Pasted below is my code,
foreach (var item in excludeSuperscript)
{
Spire.Doc.Documents.TextSelection[] selectionSup = destinationDoc.FindAllString(item, true, true);
if (selectionSup != null)
{
//Change font style for all occurrences of the word
foreach (Spire.Doc.Documents.TextSelection text in selectionSup)
{
text.GetAsOneRange().CharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
break;
}
}
}
I am new to using Spire with C#, your inputs will be really helpful.
Thanks,
Shashi