Hi
I had a macro running in Word 2007, which simply removed paragraph breaks and replaced them with spaces. It did this for the selected text, and then asked whether the user wanted to continue with the rest of the document. To this I mostly selected NO.
In 2010 the macro replaces throughout the whole document without any prompts. I checked the macro on a Word 2007 machine and the code is the same as the new macro in Word 2010.
Can anyone suggest how to overcome this bug in 2010?
Thanks, Garry
The macro code is below:
Sub RemoveParas()
'
' RemoveParas Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I had a macro running in Word 2007, which simply removed paragraph breaks and replaced them with spaces. It did this for the selected text, and then asked whether the user wanted to continue with the rest of the document. To this I mostly selected NO.
In 2010 the macro replaces throughout the whole document without any prompts. I checked the macro on a Word 2007 machine and the code is the same as the new macro in Word 2010.
Can anyone suggest how to overcome this bug in 2010?
Thanks, Garry
The macro code is below:
Sub RemoveParas()
'
' RemoveParas Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub