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

Re: How do you insert table realignment within a loop? by Jean-Guy

Jean-Guy
Wed Mar 15 12:33:46 CST 2006

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).
> 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

Like this:

End If
.Rows.Alignment = wdAlignRowRight
End With


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org