Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Test Top Line (97SR2)

    Ok, now how do I test if the IP is on the first line of a document?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Test Top Line (97SR2)

    <pre>Sub TestKevin()
    If Selection.Information(wdFirstCharacterLineNumber) = 1 _
    And Selection.Information(wdActiveEndPageNumber) = 1 Then
    MsgBox "Yup at first line of doc"
    End If
    End Sub
    </pre>


    only drawback being if more than the first line is selected, this will still say True.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Test Top Line (97SR2)

    If you only want insertion points and not other kinds of selections, you could add a third condition:

    Selection.Type = wdSelectionIP

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test Top Line (97SR2)

    You guys are great! I'm not in the office today. On Monday, I'll post what I came up with. Not quite as smooth as Gary's. And the restricting to IP only is just right. Thanks Jeff.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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