Not able to underline a string while replacing using document.Range.Replace

document.Range.Replace(data.DocReplaceText + “Page”, “p.” + pageNo, false, false);
I want to underline “p.” + pageNo . please suggested some method to underline it.


It seems you are using Aspose.Words API, so I am moving your thread to respective forums where one of our fellow colleagues will assist you soon.

@shivam23 Could you please attach your input and expected output documents here for our reference? We will check them and provide you more information.

I want this p.8 to be underlined as attached

@shivam23 Unfortunately, screenshots does not allow to analyze the issue. Could you please attach your actual MS Word document here for testing?