![]() |
#10
|
||||
|
||||
![]()
Assuming you want to start from the current selection position.
Code:
Sub TagTables2() Dim aTbl As Table, bSkip As Boolean, iCount As Integer, i As Integer, aRng As Range Set aRng = ActiveDocument.Range(Selection.Start, ActiveDocument.Range.End) bSkip = False iCount = aRng.Tables.Count For Each aTbl In aRng.Tables i = i + 1 aTbl.Select If bSkip = False Then aTbl.Range.Previous(Unit:=wdCharacter, Count:=1).InsertBefore vbCr & "AAA" bSkip = MsgBox("Yes to Extend tag, No to stop and close tag", vbYesNo) = vbYes If i = iCount Or Not bSkip Then aTbl.Range.Next(Unit:=wdCharacter, Count:=1).InsertBefore "BBB" & vbCr Exit For End If Next aTbl End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
tagging |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tagging Misspell words | ranjan | Word VBA | 3 | 08-18-2021 06:02 AM |
Word to xml tagging macro | ganesang | Word VBA | 0 | 03-19-2019 04:10 AM |
![]() |
ganesang | Word VBA | 4 | 03-13-2019 02:39 AM |
![]() |
kevinbradley57 | Word VBA | 9 | 09-21-2017 04:58 PM |
Macro for tagging and rearranging selected text for revision | caotico | Word VBA | 0 | 03-28-2012 06:35 PM |