how to check font for hyperlinks in word document content…actually when i gave any hyperlink in word document content…by default it is taking hyperlink as text in another line…how to avoid font check for tht default hyperlink…see my example given below
HYPERLINK "https://www.livemet.com/"
--by default it is taking this line how to avoid font check for this line?
https://www.livemet.com/
--which i gave in word document…by default it is taking above line too…
how to avoid font check for this one HYPERLINK "https://www.livemet.com/"
see my below code…
Document doc = new Document(@"C:\wordtemplate.docx");
// Select all runs in the document.
NodeCollection runs = doc.GetChildNodes(NodeType.Run, true, false);
foreach (Run run in runs)
{
if (!run.Text.Trim().Equals(""))
{
if (run.Font.Name != "Courier New" || run.Font.Size != 11 || (run.Font.Color.ToArgb() != Color.Black.ToArgb() && run.Font.Color.ToArgb() != Automatic.ToArgb()))
{
throw new ArgumentException("Formatting found in the document is not allowed");
}
}
}