Code:
Sub a()
Dim orng As Word.Range
Selection.HomeKey Unit:=wdStory
Do
Selection.EndKey Unit:=wdLine
If Selection.End >= ActiveDocument.Content.End - 1 Then
Exit Do
End If
Set orng = ActiveDocument.Bookmarks("\Line").Range
With orng
.Collapse wdCollapseStart
.MoveEnd wdCharacter, 1
.Select
ans = IsNumeric(orng)
If orng.Font.Bold = False And ans = False Then
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=vbTab
End If
'Do something with oRng
End With
Selection.MoveDown Unit:=wdLine
Loop
lbl_Exit:
Exit Sub
End Sub
I am using this code to insert tab for statements that are using more than 1 line.It is working well for first column but not for snaking column. I have to insert tab for all statements that are using more than 1 line.