I have an xslt routine that places some text in a Word document. The text is “glossary_term_seqnum”. The vertical alignment is set to superscript. All looks good after the document is created. See attachemnt called before.docx.
glossary_term_seqnum
Now, I want to change all the occurences of “glossary_term_seqnum” in the document to numeric sequence numbers. I use the following function that I found on the Aspose website to do this. All works fine except that I lose the formatting. The text is no longer displayed as superscript. See attachemnt called after.docx.
Currently I am using the trial version of the software where the temporary license has expired. My company has orderd the software and am currently waiting for the licensed version. Is it possible that the unlicensed version of the software might be causing this?
Please advise how I may keep this formatting.
Here is the excerpt of the code that I used.
Dim AsposeDoc As New clsAspose
Dim outputFile As String outputFile="c:temp\before.docx"
AsposeDoc.OpenAsposeDocument(outputFile)
If InStr(AsposeDoc.Range.Text, "glossary_term_seqnum") > 0 Then
AsposeDoc.Range.Replace(New System.Text.RegularExpressions.Regex("glossary_term_seqnum"), New
clsAspose.MyReplaceEvaluator(), True)
AsposeDoc.Range.UpdateFields()
AsposeDoc.SaveDoc(outputFile)
End If
Attached is the clsAspose.txt which contains a portion of my vb class
before.docx which is the document that contains the text to be replaced with the correct formatting.
after.doc is the document that show the replaced text with the incorrect formatting.
Thank You!