• Determining if you are in an end of row marker (Word 2003)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Determining if you are in an end of row marker (Word 2003)

    Author
    Topic
    #435465

    In a macro I have designed I move down one paragraph in a table. In some cases, this results in the cursor ending up to the right of the last column in the end of row marker.

    Is there a way in VBA to determine if you are in an end of row marker, so I can take appropriate action?

    Thanks!!
    Troy

    Viewing 0 reply threads
    Author
    Replies
    • #1029314

      Edited by StuartR to replace a complicated method with a much simpler one

      I think that the simplest way is to check if
      Selection.Information(wdAtEndOfRowMarker) is True

      StuartR

      • #1029546

        Works great!! The help actually mentions a couple of things. The syntax was actually different from the example.

        IsEndOfRowMark Property
        See AlsoApplies ToExampleSpecificsTrue if the specified selection or range is collapsed and is located at the end-of-row mark in a table. Read-only Boolean.

        Note This property is the equivalent of the following expression:

        Selection.Information(wdAtEndOfRowMarker)

        Example
        This example collapses the selection and selects the current row if the insertion point is at the end of the row (just before the end-of-row mark).

        Selection.Collapse Direction:=wdCollapseEnd
        If Selection.IsEndOfRowMark = True Then
            Selection.Rows(1).Select
        End If

        Either one of them works. I searched several ways in the help, but never found this topic.

        Thanks for the help!!
        Troy

    Viewing 0 reply threads
    Reply To: Determining if you are in an end of row marker (Word 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: