Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-16-2020, 02:57 PM
Guessed's Avatar
Guessed Guessed is offline Formatting Nested Tables Windows 10 Formatting Nested Tables 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

Word does consider nested tables to be tables, the problem is just that the nested tables are contained inside other tables. For instance, to get to the first level of nesting
Code:
Sub TestTables()
  Dim aTbl As Table, aTblN As Table
  For Each aTbl In ActiveDocument.Tables
    Debug.Print aTbl.NestingLevel
    For Each aTblN In aTbl.Tables
      Debug.Print aTbl.NestingLevel, aTblN.NestingLevel
    Next aTblN
  Next aTbl
End Sub
The next trick is to come up with a recursive function so that you can drill into deeper nesting levels. This thread vba - Find/Count all tables in the document's body (including all nested tables of all levels) - Stack Overflow has more inspiration for you.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile text from multiple tables into a cell in a nested table jrooney7 Word VBA 2 03-11-2019 07:55 AM
Removing KeepWithNext Formatting from Nested Tables? Jfedora Word VBA 3 06-06-2017 11:49 AM
Nested tables. Count rows NevilleT Word VBA 9 05-10-2017 05:22 AM
Formatting all tables knightmetal Word 2 09-10-2012 10:53 PM
Nested vlookup with varable tables! Dave Jones Excel 0 08-30-2012 09:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:03 PM.


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