Free Support Forum - aspose.com

How to read Hyper links in Word document in VB.NET

Hi

Read Hyper links in Word document in VB.NET


Thanks
Anil K.

Hi Anil,


Thanks for your inquiry. Please check following sample code snippet for reading Hyperlinks in Word document. Please also check documentation link for more details.

Dim doc As New Document(“input.docx”)<o:p></o:p>

’ Hyperlinks in a Word documents are
fields.
<o:p></o:p>

For Each field As Field In
doc.Range.Fields<o:p></o:p>

If field.Type = FieldType.FieldHyperlink Then<o:p></o:p>

Dim hyperlink As
FieldHyperlink = DirectCast(field, FieldHyperlink)<o:p></o:p>

Console.WriteLine(hyperlink.Address)<o:p></o:p>

End If<o:p></o:p>

Next<o:p></o:p>

....

....


Please feel free to contact us for any further assistance.

Best Regards,

Thanks Tilal Ahmad it’s working fine.