Thread: [Solved] Table Formatting
View Single Post
 
Old 04-10-2012, 06:30 PM
ubns ubns is offline Windows 7 32bit Office 2010 32bit
Competent Performer
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default

I have kind of got the following code and ammended little bit. Here is a code:


' resize tables
Sub TablesOptimize()
Dim myTable As Table
For Each myTable In ActiveDocument.Tables
myTable.AutoFitBehavior (wdAutoFitContent)

myTable.AutoFormat Format:=35


' 35 is good format of table. can it bit lighter. how to create your own style
' and then include it. also how to change font and also include dollay symebol.
'With myTable.Borders
' .InsideLineStyle = wdLineStyleDot
' .OutsideLineStyle = wdLineStyleDouble

'End With
Next myTable

ActiveDocument.Repaginate

For Each myTable In ActiveDocument.Tables
myTable.AutoFitBehavior (wdAutoFitWindow)
Next myTable

ActiveDocument.Repaginate
For Each myTable In ActiveDocument.Tables
myTable.AutoFitBehavior (wdAutoFitFixed)
Next myTable
ActiveDocument.Repaginate
End Sub


I wanted to seek help regarding the following:

1) How can we write the complete code (sentence) if I have to change the font size using mytable.autoformat.

2) Is there a way we can change the table style, align the text in the centre of the cell, change the font size to 9.

3) We want to do this on selective tables, not all tables.



Regards

Last edited by macropod; 04-10-2012 at 06:35 PM. Reason: Stripped off content relating to another thread.
Reply With Quote