B
Bill Foley
I have code that goes through my document and removes all instances of a
BarTab (at 7.25 inches) and changes the RED color back to BLACK. I am
trying to modify my existing macro to just remove the current TAB on the
paragraph where my cursor lives.
My current macro is:
Sub RemoveRedLine()
' This removes the RedLines (normally when a PCN'd document is now Rev'd)
Dim Msg, Style, Title, Response
Msg = "You are about to remove all redlines! Do you want to continue?" '
Define message
Style = vbYesNo + vbDefaultButton2 ' Define buttons.
Title = "Redline Deletion" ' Define title.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
Application.ScreenUpdating = False
Dim oPara As Paragraph
Dim oTabStop As TabStop
For Each oPara In ActiveDocument.Paragraphs
For Each oTabStop In oPara.TabStops
If oTabStop.Position = InchesToPoints(7.25) _
And oTabStop.Alignment = wdAlignTabBar Then
oTabStop.Clear
End If
Next oTabStop
Next oPara
Selection.WholeStory
Selection.Font.Color = wdColorBlack
Selection.HomeKey Unit:=wdStory
Application.ScreenUpdating = True
Else ' User chose No.
End If
End Sub
I've tried using:
Dim oTabStop As TabStop
For Each oTabStop In Selection.Paragraphs
If oTabStop.Position = InchesToPoints(7.25) _
And oTabStop.Alignment = wdAlignTabBar Then
oTabStop.Clear
End If
Next oTabStop
It is easy to clear ALL the TABs of the current paragraph, but I just want
to clear the one at 7.25.
Any assistance would be greatly appreciated.
Bill
BarTab (at 7.25 inches) and changes the RED color back to BLACK. I am
trying to modify my existing macro to just remove the current TAB on the
paragraph where my cursor lives.
My current macro is:
Sub RemoveRedLine()
' This removes the RedLines (normally when a PCN'd document is now Rev'd)
Dim Msg, Style, Title, Response
Msg = "You are about to remove all redlines! Do you want to continue?" '
Define message
Style = vbYesNo + vbDefaultButton2 ' Define buttons.
Title = "Redline Deletion" ' Define title.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
Application.ScreenUpdating = False
Dim oPara As Paragraph
Dim oTabStop As TabStop
For Each oPara In ActiveDocument.Paragraphs
For Each oTabStop In oPara.TabStops
If oTabStop.Position = InchesToPoints(7.25) _
And oTabStop.Alignment = wdAlignTabBar Then
oTabStop.Clear
End If
Next oTabStop
Next oPara
Selection.WholeStory
Selection.Font.Color = wdColorBlack
Selection.HomeKey Unit:=wdStory
Application.ScreenUpdating = True
Else ' User chose No.
End If
End Sub
I've tried using:
Dim oTabStop As TabStop
For Each oTabStop In Selection.Paragraphs
If oTabStop.Position = InchesToPoints(7.25) _
And oTabStop.Alignment = wdAlignTabBar Then
oTabStop.Clear
End If
Next oTabStop
It is easy to clear ALL the TABs of the current paragraph, but I just want
to clear the one at 7.25.
Any assistance would be greatly appreciated.
Bill