Reply
 
Thread Tools Display Modes
  #1   Report Post  
k2sarah
 
Posts: n/a
Default reference to nested tables

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?
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default reference to nested tables

On Tue, 25 Oct 2005 12:21:03 -0700, "k2sarah"
wrote:

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
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
footnote reference style different in text to footnote pane versio Lloyd Microsoft Word Help 2 October 19th 05 10:47 AM
Help with nested tables Anasazi Tables 2 March 18th 05 04:42 AM
How do I "un-nest" a table from nested tables? Triplecee Tables 1 March 16th 05 02:19 PM
When joining tables, table sections shift left or right. JEB01 Tables 1 January 17th 05 07:57 PM


All times are GMT +1. The time now is 12:46 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"