Take a look at this code (from MS Word):
Option Explicit
Sub FindTabs()
Dim doc As Document
Dim rng As Range, fnd As Range
On Error GoTo Err_FindTabs
Set doc = ActiveDocument
Set rng = doc.Range
With rng.Find
.ClearFormatting
.Text = "^t"
.MatchWildcards = True
.Forward = True
Do While .Execute()
Set fnd = rng.Find.Parent
fnd.Underline = wdUnderlineDouble
Loop
End With
Exit_FindTabs:
On Error Resume Next
Set fnd = Nothing
Set rng = Nothing
Set doc = Nothing
Exit Sub
Err_FindTabs:
MsgBox Err.Description, vbExclamation, Err.Number
Resume Exit_FindTabs
End Sub
To use it in Vb.Net, you need to create instance of MS Word Application - like this:
wrdApp = CreateObject("Word.Application")
To change wdUnderline constant to its value, see
here