1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Word Macro not working properly in Word 2010

Discussion in 'Business Applications' started by Garrry, Oct 21, 2010.

Thread Status:
Not open for further replies.
  1. Garrry

    Garrry Thread Starter

    Joined:
    Oct 21, 2010
    Messages:
    1
    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
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/957577

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice