A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

search for tables w/i a table



 
 
Thread Tools Display Modes
  #1  
Old November 7th, 2006, 12:31 AM posted to microsoft.public.word.tables
adgorn
external usenet poster
 
Posts: 25
Default search for tables w/i a table

I have a big table, and w/i some cells are little tables. I need to search
for each of those little tables. The table browse object won't do it.

What I am ultimately trying to do is extract each of the little tables (to
modify them separately), tag them with some identifier, leave behind a
placeholder, then be able to put them back when I'd done manipulating them.

I'd be happy if I could just cycle through all the tables first.
--
Alan
  #2  
Old November 7th, 2006, 10:44 AM posted to microsoft.public.word.tables
Helmut Weber
external usenet poster
 
Posts: 131
Default search for tables w/i a table

Hi,

I would not rely on something recursive, like tables in tables,
as long as the limit for the recursiveness is unknown.

Sub Test444()
Dim oTbl As Table
Dim oCll As Cell
For Each oTbl In ActiveDocument.Tables
For Each oCll In oTbl.Range.Cells
If oCll.Tables.Count 0 Then
oCll.Tables(1).Select
Stop
End If
Next
Next
End Sub

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

  #3  
Old November 7th, 2006, 11:02 AM posted to microsoft.public.word.tables
Tony Jollans
external usenet poster
 
Posts: 1,297
Default search for tables w/i a table

Tables form a hierarchy within a document, so in VBA you can do this:

For Each t In ActiveDocument.Tables(1).Tables
t.Select
Next

You need to have a way of identifying the outer table but then you can do
what you want with the inner ones.

--
Enjoy,
Tony

"adgorn" wrote in message
...
I have a big table, and w/i some cells are little tables. I need to search
for each of those little tables. The table browse object won't do it.

What I am ultimately trying to do is extract each of the little tables (to
modify them separately), tag them with some identifier, leave behind a
placeholder, then be able to put them back when I'd done manipulating
them.

I'd be happy if I could just cycle through all the tables first.
--
Alan


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.