Results 1 to 5 of 5

Thread: [RESOLVED] How to find in returns(vbcrlf) in VBA

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Resolved [RESOLVED] How to find in returns(vbcrlf) in VBA

    Code:
    With Selection.Find
        .Text = vbCrLf & vbCrLf
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    MsgBox Selection.Find.Execute
    The above code returing false value. please help me to replace two ENTERS to one ENTER.
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  2. #2
    Fanatic Member dmaruca's Avatar
    Join Date
    May 2006
    Location
    Jacksonville, FL
    Posts
    577

    Re: How to find in returns(vbcrlf) in VBA

    Code:
    With Selection.Find
        .Text = "^13^13"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = True
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    MsgBox Selection.Find.Execute
    Click Here to read more about this topic.

  3. #3
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: How to find in returns(vbcrlf) in VBA

    Code:
        With ActiveDocument.Range.Find
            .Forward = True
            .Wrap = wdFindContinue
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
            Do
                .Text = "^p^p"
                .Replacement.Text = "^p"
            Loop Until .Execute = False
        End With
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: How to find in returns(vbcrlf) in VBA

    then how to find string ^13.

    please dont mistake me, I am just asking
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: How to find in returns(vbcrlf) in VBA

    Quote Originally Posted by anhn
    Code:
        With ActiveDocument.Range.Find
            .Forward = True
            .Wrap = wdFindContinue
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
            Do
                .Text = "^p^p"
                .Replacement.Text = "^p"
            Loop Until .Execute = False
        End With
    thank you
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

Posting Permissions

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



Click Here to Expand Forum to Full Width