Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro (Word 2000)

    Hi everyone,

    I am trying to write a macro that will select text from wherever the insertion point is located until it finds two returns and I have been unable to do so. I have looked on all my books but to no avail. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15> Any help will be greatly appreciated.

    Thank you

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Word 2000)

    Here's something more or less direct from a recorded macro. The Selection.Extend is achieved by pressing the F8 key once. Esc cancels the extended selection mode.

    Sub SelectToDblePara()
    Selection.Extend
    Selection.Find.ClearFormatting
    With Selection.Find
    .Text = "^p^p"
    .Forward = True
    End With
    Selection.Find.Execute
    End Sub

    Alan

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Word 2000)

    Thank you so much for your replay Alan, but I guess I didn

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Word 2000)

    If there is a paragraph mark

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Word 2000)

    <pre>
    Public Sub ExtendRangeToDoublePara()
    ' Suggested by Howard Kaikow on 5 October 2003, while he was doing laundry
    ' Modified after finished doing laundrry,
    ' Does not change selection unless critter is found
    Dim lngStart As Long
    Dim rngCurrent As Range

    Set rngCurrent = Selection.Range

    With rngCurrent
    .Collapse direction:=wdCollapseStart
    lngStart = .Start
    With .Find
    .Text = "^p^p"
    .Execute
    If .Found Then
    ActiveDocument.Range(Start:=lngStart, End:=rngCurrent.End).Select
    Else
    MsgBox "Seek anf thou shalt find", vbInformation, "Not found"
    End If
    End With
    End With
    End Sub
    </pre>


  6. #6
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro (Word 2000)

    Thank you Alan. There's nothing worst than when you just don't see something so obvious. Thank you too Howard.

Posting Permissions

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