Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-21-2022, 09:44 PM
Guessed's Avatar
Guessed Guessed is offline Table Tagging Windows 10 Table Tagging Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this code
Code:
Sub TagTables()
  Dim aTbl As Table, bSkip As Boolean, iCount As Integer, i As Integer
  iCount = ActiveDocument.Tables.Count
  For i = 1 To iCount
    Set aTbl = ActiveDocument.Tables(i)
    aTbl.Select
    If Not bSkip Then
      aTbl.Range.Previous(Unit:=wdCharacter, Count:=1).InsertBefore vbCr & "AAA"
      bSkip = MsgBox("Yes to Extend tag, No to close tag", vbYesNo) = vbYes
      If Not bSkip Then aTbl.Range.Next(Unit:=wdCharacter, Count:=1).InsertBefore "BBB" & vbCr
    Else
      bSkip = MsgBox("Yes to Extend tag, No to close tag", vbYesNo) = vbYes
      If bSkip = False Then
        aTbl.Range.Next(Unit:=wdCharacter, Count:=1).InsertBefore "BBB" & vbCr
      End If
      If i = iCount - 1 Then bSkip = False
    End If
  Next i
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
tagging

Thread Tools
Display Modes


Similar Threads
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
Table Tagging Need macro for XML tagging in word doc ganesang Word VBA 4 03-13-2019 02:39 AM
Table Tagging Code to find a named (bookmarked?) table, replicate a row or table, and delete a specified table. 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft