View Single Post
 
Old 08-12-2014, 08:09 PM
scubadunc scubadunc is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Aug 2014
Posts: 6
scubadunc is on a distinguished road
Default

Hi Paul

Found a workaround for the time being...merge to a new document then use a couple of macros to search for a 7 column table...autofit it to window and then right align column 7...Then I just have a separate right aligned total field.

Sub ResizeTable()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
With oTbl
If .Columns.Count = 7 Then
.AutoFitBehavior Behavior:=wdAutoFitWindow
End If
End With
Next oTbl
End Sub

Sub RightAlignColumn7()
Dim oTable As Table
Dim oCol As Column
Dim oCell As Cell
For Each oTable In ActiveDocument.Tables
For Each oCol In oTable.Columns
If oCol.Index = 7 Then
For Each oCell In oCol.Cells
oCell.Range.ParagraphFormat.Alignment _
= wdAlignParagraphRight
Next
End If
Next
Next
End Sub

Last edited by scubadunc; 08-12-2014 at 10:44 PM.
Reply With Quote