
Ignore strikethrough text in document character count
Hi Joel,
The most efficient way to do this is to delete the strikethrough text,
retrieve the character count, and then replace the strikethrough text.
MsgBox "Starting character count: " & _
ActiveDocument.Characters.Count
With Selection
.HomeKey unit:=wdStory
With .Find
.ClearFormatting
.Font.StrikeThrough = True
.Text = ""
With .Replacement
.ClearFormatting
.Text = ""
End With
.Execute Replace:=wdReplaceAll
End With
End With
MsgBox "Ending character count: " & _
ActiveDocument.Characters.Count
' restore the strikethrough text
ActiveDocument.Undo
HTH
Quote:
> I would like to write a macro that counts every character in a
> document but ignores any strikethrough text. Does anyone have a
> suggestion on how I would approach this?.....thanks for your help
> -- Joel Swanson