Good afternoon, I have a macro that I have used for editing documents and I am running into an issue. A part of the macro finds strikethrough text and then deletes it. However, I get an error at the wrd.delete portion of this macro:
Private Sub RemoveStrikeThrough()
Dim wrd As Range
Dim rng As Word.Range
For Each rng In ActiveDocument.StoryRanges 'get first story of each story type
For Each wrd In rng.Words
If wrd.Font.StrikeThrough = True Then
Set rng = rng.NextStoryRange 'get next story of this story type
Loop Until rng Is Nothing
Can anyone help me understand why this won't execute correctly?
You don't tell us what error you are getting, but there is always a danger when using the For Next construct if a member of the collection is deleted. The pointer to the next member is not always correct
Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!
Shortcuts in Word
Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…