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 2006

Tip: Looking for answers? Try searching our database.

How do you insert table realignment within a loop?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MichaelB - 15 Mar 2006 17:31 GMT
Can someone help me insert a statement that would realign the table to right
of the page (the below script was provided by Jay Freedman). I believe the
statement is Rows.Alignment = wdAlignRowRight but I’m having trouble
inserting into the loop so that all the tables within the document are
realigned.  Any help would be greatly appreciated.

Thanks
Mike

********************************

Sub ResizeTables()
    Dim oTbl As Table

    For Each oTbl In ActiveDocument.Tables
        With oTbl
            If .Columns.Count = 4 Then
                .AutoFitBehavior Behavior:=wdAutoFitFixed
                .Columns.PreferredWidthType = wdPreferredWidthPoints
                .Columns(1).PreferredWidth = InchesToPoints(1#)
                .Columns(2).PreferredWidth = InchesToPoints(0.69)
                .Columns(3).PreferredWidth = InchesToPoints(0.63)
                .Columns(4).PreferredWidth = InchesToPoints(3#)
            End If
        End With
    Next oTbl
End Sub

Jean-Guy Marcil - 15 Mar 2006 19:33 GMT
MichaelB was telling us:
MichaelB nous racontait que :

> Can someone help me insert a statement that would realign the table
> to right of the page (the below script was provided by Jay Freedman).
[quoted text clipped - 23 lines]
>     Next oTbl
> End Sub

Like this:

            End If
            .Rows.Alignment = wdAlignRowRight
        End With

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.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.