Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Oct 2001
    Location
    New York, New York, USA
    Posts
    538
    Thanks
    0
    Thanked 1 Time in 1 Post

    Macro to del paragraph marks (Wprd97, SR2)

    Morning,

    Having problem troubleshooting this simple macro: I

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro to del paragraph marks (Wprd97, SR2)

    There are several problems with your macro.

    Here is an improved version:

    With Selection.Find
    .Text = "^p"
    .Replacement.Text = " "
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute Replace:=wdReplaceAll
    End With
    Selection.MoveLeft Unit:=wdSentence

    Remarks:
    <UL><LI>This is not a wildcard search, so I have set the find text to "^p" and MatchWildcards to False
    <LI>I have put the Execute within the With ... End With block
    <LI>.MoveLeft is invalid outside a With ... End With block
    <LI>wdParagraph is not valid for MoveLeft, it is intended for MoveUp or MoveDown
    <LI>Since you want the cursor to be an IP, you should not use wdExtend.[/list]

  3. #3
    4 Star Lounger
    Join Date
    Oct 2001
    Location
    New York, New York, USA
    Posts
    538
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro to del paragraph marks (Wprd97, SR2)

    Perfect! Many, many thanks, HansV

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •