CursorBeforeAllTags Script

Build 1501 on 14/Nov/2017  This topic last edited on: 9/May/2012, at 13:03

Description

Moves the cursor before all tags in the current paragraph or at the beginning of the text if the paragraph is the first one.

Syntax

CursorBeforeAllTags

Code

  Public Function CursorBeforeAllTags()

    ' puts the cursor before all tags in the current paragraph, or on the beg of text

    Dim oC = Text.GetCursor(modeSrcOn, cposCursor, False)

    Dim oCD = oC.GetDesc

    Dim oT = oC.Duplicate

    Dim s As String = ""

    Do  ' handle also long tag strings of tables

      Dim oDT = oT.GetDesc

      If oDT.GetType = tptPara Then

        oT.Move(1)

        Exit Do

      End If

      If oT.Move(-1) <> 0 Then Exit Do

    Loop

    Return oT

  End Function