L
Lachezar Parvov
Hi. I use this:
Public AllTags As New Collection
Public AllPoss As New Collection
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
..Pattern = "\[\[|\]\]|\["
..IgnoreCase = True
..Global = True
End With
Set Matches = RegularExpressionObject.Execute(doc.Range.Text)
For Each Match In Matches
AllTags.Add (Match.Value)
AllPoss.Add (Match.FirstIndex)
Next
In other function when I want to delete some range:
Dim rang As Range
Set rang = doc.Range
rang.SetRange AllPoss(k - 1), AllPoss(k)
rang.Delete
It is ok but if I have tables in word document the range is other.
Example: If original postion is 30, This code Match.FirstIndex return 32
when position 30 is in Table. If we have not table Match.FirstIndex return
30. If wi have table original postion is 30 but Match.FirstIndex return 32.
Pleace help me. How I can get original postion in table?
Public AllTags As New Collection
Public AllPoss As New Collection
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
..Pattern = "\[\[|\]\]|\["
..IgnoreCase = True
..Global = True
End With
Set Matches = RegularExpressionObject.Execute(doc.Range.Text)
For Each Match In Matches
AllTags.Add (Match.Value)
AllPoss.Add (Match.FirstIndex)
Next
In other function when I want to delete some range:
Dim rang As Range
Set rang = doc.Range
rang.SetRange AllPoss(k - 1), AllPoss(k)
rang.Delete
It is ok but if I have tables in word document the range is other.
Example: If original postion is 30, This code Match.FirstIndex return 32
when position 30 is in Table. If we have not table Match.FirstIndex return
30. If wi have table original postion is 30 but Match.FirstIndex return 32.
Pleace help me. How I can get original postion in table?