E
Ed
I was trying to create a macro to delete a leading tab from a selection. It
worked fine, iterating through each paragraph of the range - except it did
not see the tab at the beginning of a paragraph. I used:
Dim objP As Paragraph
Dim rngThis As Range
Set rngThis = Selection.Range
For Each objP In rngThis.Paragraphs
If objP.Range.Characters(1) = "^t" Then
objP.Range.Characters(1).Delete
End If
Next objP
I resolved it using Asc:
If Asc(objP.Range.Characters(1)) = 9 Then
objP.Range.Characters(1).Delete
End If
What was I missing trying to use "^t"?
Ed
worked fine, iterating through each paragraph of the range - except it did
not see the tab at the beginning of a paragraph. I used:
Dim objP As Paragraph
Dim rngThis As Range
Set rngThis = Selection.Range
For Each objP In rngThis.Paragraphs
If objP.Range.Characters(1) = "^t" Then
objP.Range.Characters(1).Delete
End If
Next objP
I resolved it using Asc:
If Asc(objP.Range.Characters(1)) = 9 Then
objP.Range.Characters(1).Delete
End If
What was I missing trying to use "^t"?
Ed