Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Tables / October 2005

Tip: Looking for answers? Try searching our database.

reference to nested tables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
k2sarah - 25 Oct 2005 20:21 GMT
i have created in word a nested table. outside table is 2x2, and in cell (row
2 column 2) i have a nested table which is 3x3. i am having trouble refering
to the nested table via vba and make changes. can anyone provide the code
whereby, i can make a reference to the nested table and modify cells in the
nested table?
Jay Freedman - 26 Oct 2005 04:23 GMT
>i have created in word a nested table. outside table is 2x2, and in cell (row
>2 column 2) i have a nested table which is 3x3. i am having trouble refering
>to the nested table via vba and make changes. can anyone provide the code
>whereby, i can make a reference to the nested table and modify cells in the
>nested table?

This sample shows how to drill down through the structure. Once you
see how the parts are related, you can start taking shortcuts instead
of explicitly assigning each part along the way.

Sub Test()
   Dim outerTable As Table, innerTable As Table
   Dim outerCell As Cell, innerCell As Cell
   
   
   Set outerTable = ActiveDocument.Tables(1)
   Set outerCell = outerTable.Cell(2, 2)
   
   Set innerTable = outerCell.Tables(1)
   Set innerCell = innerTable.Cell(3, 3)

   innerCell.Range.Text = "Cell(3,3)"
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.