Consulting

Results 1 to 12 of 12

Thread: Re: Start of line and end of line problem

  1. #1
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    114
    Location

    Re: Start of line and end of line problem


  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You can do that with an ordinary Find: ^l^l. No VBA required.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    114
    Location
    Quote Originally Posted by macropod View Post
    You can do that with an ordinary Find: ^l^l. No VBA required.
    doesn't work that way


    the script will just find
    a linebreak on a empty line
    and a linebreak on a empty line

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    It does work for the examples you posted. What you haven't defined is what precedes the first line break.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    114
    Location

    re

    Quote Originally Posted by macropod View Post
    It does work for the examples you posted. What you haven't defined is what precedes the first line break.

    well it find the linebreaks,
    but I want the linebreaks have to be on empty lines
    with no text before neither after.
    Attached Images Attached Images

  6. #6
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You cannot have line breaks with nothing before them unless they're the very first things that exist in the document. Except for that one possibility, there must always be other characters (e.g. letters, numbers, paragraph breaks, other line breaks, etc.). You need to define what those other characters are.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  7. #7
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    114
    Location
    well if you see on my pictures I have something before
    hej hej hej(linebreak)
    (linebreak)

    if you know regex there is possible to use the command

    start of line "linebreak"
    end of line "linebreak"

    you know?

  8. #8
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Please read my previous post and take time to understand it. Posting the same pictures over and over when they don't adequately show the context in which the line breaks are occurring doesn't change anything. If you want to post something, post an actual document showing the line breaks as they occur in it (not in another picture).
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  9. #9
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    114
    Location
    sorry,

    well I could grab the linebreaks by using ^l^l^$

    ^$ (end of line)
    but still struggling with start of line.
    and I understood your answer.

    how should you solve this then?

  10. #10
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    The solution depends on what precedes the linebreaks, not what follows them. You seem determined not to say what precedes them or to post a document showing it. Unless you do that, you are just wasting time.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  11. #11
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    114
    Location
    its different text before so its impossible to know
    ok.jpg

  12. #12
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Please read posts 6, 8 and 10 AGAIN. Posting images is wasting time. I'm not going to waste more of my time on someone who won't cooperate.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Tags for this Thread

Posting Permissions

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