Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding the Beginning of a Line (Word 2000)

    How do I find the beginning of a line using wildcards?

    For example, I want to be able to find " ->" at the beginning of a line, but not the " ->" in "A test -> string".

    Thanks.

  2. #2
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Oregon, USA
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding the Beginning of a Line (Word 2000)

    Hi Bill,

    Insert ^p before the string. That'll find a paragraph mark followed by what you're looking for.

    HTH,

    Chris

  3. #3
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding the Beginning of a Line (Word 2000)

    That works unless it's at the beginning of the file. The first line doesn't have a paragraph mark before it. Why doesn't Microsoft implement wildcards that match the regular expression syntax of UNIX?

    Oh well, just dreaming again.

  4. #4
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Oregon, USA
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding the Beginning of a Line (Word 2000)

    <P ID="edit" class=small>Edited by Chris Green on 18-Oct-01 14:30.</P>Ahhh. Well, I don't call it "Workaround" for nothing. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> Here's a couple workarounds for you, neither of which are very elegant.

    1) Insert a blank paragraph at the beginning of each document. Format it at 1 pt and color white. It won't be very noticable.

    2) If you're not averse to using a macro, the following should suffice.

    <pre>Sub FindString()
    '
    Dim blnFound As Boolean
    Dim strFind As String

    blnFound = False


    Selection.Find.ClearFormatting
    With Selection.Find
    .Forward = True
    .Wrap = wdFindContinue
    .Text = "->"
    Do
    .Execute
    strFind = Selection.Paragraphs(1).Range.Text
    If InStr(1, strFind, "->") = 1 Then
    blnFound = True
    End If
    Loop Until blnFound = True Or .Found = False
    End With

    End Sub
    </pre>


    HTH,

    Chris

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding the Beginning of a Line (Word 2000)

    Hi Bill,

    >> Oh well, just dreaming again.

    I told <A target="_blank" HREF=http://register.microsoft.com/mswish/suggestion.asp>mswish@microsoft.com</A> about my dream (having anchors for the beginning and end of paragraphs, like the word-anchors < and >).
    Perhaps << and >> could be used: those are invalid search strings at the moment, and no new "special characters" would be needed.
    If you do, too, that will double our chances to see that implemented <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding the Beginning of a Line (Word 2000)

    Hi Klaus:

    We'll triple our chances. I just echoed your sentiments. I also added that paragraph marks should be in front of paragraphs & that section breaks should contain formatting for the section following. Fat chance, huh? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

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