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 / March 2004

Tip: Looking for answers? Try searching our database.

Do this for each table found

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nicole - 31 Mar 2004 17:30 GMT
I want to run this code for every table found in my document

   Selection.Tables(1).Select
   Selection.Borders(wdBorderTop).LineStyle = wdLineStyleNone
   Selection.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
   Selection.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
   Selection.Borders(wdBorderRight).LineStyle = wdLineStyleNone
   Selection.Borders(wdBorderVertical).LineStyle = wdLineStyleNone

I can only figure out how to do it for one table ... and I'm no good at
loops in VB.

Any suggestions?

Thanks
Nicole
Dave Lett - 31 Mar 2004 17:34 GMT
Hi Nicole,

You can try the following:

Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
   With oTbl
       ''' it looks like you're trying to remove _all_ borders, so
       ''' I added wdBorderHorizontal
       .Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone
       .Borders(wdBorderTop).LineStyle = wdLineStyleNone
       .Borders(wdBorderLeft).LineStyle = wdLineStyleNone
       .Borders(wdBorderBottom).LineStyle = wdLineStyleNone
       .Borders(wdBorderRight).LineStyle = wdLineStyleNone
       .Borders(wdBorderVertical).LineStyle = wdLineStyleNone
   End With
Next oTbl

HTH,
Dave
> I want to run this code for every table found in my document
>
[quoted text clipped - 12 lines]
> Thanks
> Nicole
Nicole - 31 Mar 2004 17:53 GMT
Thanks that did it!

> Hi Nicole,
>
[quoted text clipped - 32 lines]
> > Thanks
> > Nicole
 
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.