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 / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Macro to select ALL tables (with different styles) in a word docum

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Von Stussi - 12 May 2008 04:46 GMT
sorry if it is a repost(?)

How to select ALL the tables (with different Table styles) in a word
document (by exemple to apply a "table formatting macro" or a new table style
to all the tables in the document at once).

I cannot select all the tables at once using the Styles and Formatting pane
because the documents have several table with different table styles.
I would like to avoid scrolling in the document and hold the CTL key + click
in every tables.

I have looked for selecting all the tables using the the Find (F5) function
in word, but I found "tables" nowhere in the options list.

Is there is a solution with the Find function or/and with a Macro?

Not sure if I explain well, so ask me if you need further precisions.

Thanks
Helmut Weber - 12 May 2008 08:02 GMT
Hi Stussi,

like that:

Sub Macro2()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
 oTbl.Style = "Table Columns 2"
 ' more options
Next
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
MT - 14 May 2008 09:28 GMT
Hi Helmut,

Thanks for the Macro, however that is not what I am looking for. I try to be
more explicite in this post:

(start)
I need a Macro to select ALL the table in a word doc (word2003) as if I was
CTRL + selecting all the table in the doc one after one till to have all
blackened on screen - i.e. selected. No more than that.
(end)

I am sorry, the first post is somewhat confusing. What I meant by: [...] to
apply a "table formatting macro" [...] refered only to apply some Macros I
made to format the tables afterward.

Best Regards,

Mark Von Stussi
Osaka, Japan

> Hi Stussi,
>
[quoted text clipped - 15 lines]
>
> Vista Small Business, Office XP
MT - 14 May 2008 09:43 GMT
By the way, your Macro is of a good use when I want to apply any word styles
or mines directly. So, thanks again.

The Macro I need to select ALL the table should allow me apply direct
formatting at once in a doc I believe. It is a good alternative for me.

Cheers,

Mark Von Stussi

> Hi Stussi,
>
[quoted text clipped - 15 lines]
>
> Vista Small Business, Office XP
Graham Mayor - 14 May 2008 12:18 GMT
You can only select the tables one at a time - as in Helmut's macro.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> By the way, your Macro is of a good use when I want to apply any word
> styles or mines directly. So, thanks again.
[quoted text clipped - 26 lines]
>>
>> Vista Small Business, Office XP
MT - 18 May 2008 10:11 GMT
Thanks you for your answer Grahm Mayor,
Helmut's macro select all the tables in the document and apply a formatting
style. I would like to select all the table without applying a formatting
style. Just have them selected.

Shall I understand your answer as: it can be done this way??

Best regards,
Mark

> You can only select the tables one at a time - as in Helmut's macro.
>
[quoted text clipped - 28 lines]
> >>
> >> Vista Small Business, Office XP
Graham Mayor - 18 May 2008 10:28 GMT
You can only select one table at a time.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Thanks you for your answer Grahm Mayor,
> Helmut's macro select all the tables in the document and apply a
[quoted text clipped - 46 lines]
>>>>
>>>> Vista Small Business, Office XP
 
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.