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")
' Hyperlinks in a Word documents are fields.
For Each field As Field In
doc.Range.Fields
    If field.Type = FieldType.FieldHyperlink Then
        Dim hyperlink As FieldHyperlink = DirectCast(field, FieldHyperlink)
        Console.WriteLine(hyperlink.Address)
    End If
Next

Please feel free to contact us for any further assistance.

Best Regards,

Thanks Tilal Ahmad it’s working fine.