J
jec
Hi, macro does not work in Word 2007? It throws a Range error? Works fine in Word 2003. The text is selected and range redacted. Any ideas please?
'Set rgeRedact = Selection.Range **** Compile error method or data member not found!
Sub TestMe1()
Dim rgeRedact As Range
Dim lngCount As Long
Dim i As Long
Set rgeRedact = Selection.Range '*** Compile error method or data member not found!
If Selection.Type = wdSelectionIP Then
MsgBox Prompt:="Please select some text to redact! Exiting macro..."
Exit Sub
Else
With rgeRedact
lngCount = .Characters.Count
For i = 1 To lngCount
If Asc(.Characters(i)) > 20 Then
.Characters(i).Text = "_"
End If
Next
.MoveEnd wdCharacter, 1
.HighlightColorIndex = wdBlack
End With
End If
End Sub
'Set rgeRedact = Selection.Range **** Compile error method or data member not found!
Sub TestMe1()
Dim rgeRedact As Range
Dim lngCount As Long
Dim i As Long
Set rgeRedact = Selection.Range '*** Compile error method or data member not found!
If Selection.Type = wdSelectionIP Then
MsgBox Prompt:="Please select some text to redact! Exiting macro..."
Exit Sub
Else
With rgeRedact
lngCount = .Characters.Count
For i = 1 To lngCount
If Asc(.Characters(i)) > 20 Then
.Characters(i).Text = "_"
End If
Next
.MoveEnd wdCharacter, 1
.HighlightColorIndex = wdBlack
End With
End If
End Sub