pk247
10-19-2016, 03:53 PM
Hi All,
I was wondring if someone could help me update my code to work with all tables after the third table in a Word document please? Currently all tables are updated with this code and then I manually select tables 1, 2 and 3 and change them back to their original way - which is now becoming a real burden for me.
Can anyone help please? Is there a way to say For each Table(>3)...? There is no finite end range so I don't believe I can specify a Start and an End.
Here's my code so far:
Sub Format_TEMPLATE_Tables()
Dim oTbl As Word.Table
Dim oCell As Word.Cell
For Each oTbl In ActiveDocument.Tables
For Each oCell In oTbl.Range.Cells
oCell.Range.ParagraphFormat.Alignment = wdCellAlignVerticalCenter
oCell.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft
oCell.Range.ParagraphFormat.SpaceBefore = 0
oCell.Range.Font.Name = "Calibri"
oCell.Range.Font.Size = 11
Next oCell
Next oTbl
End Sub
Thanks again!
Paul, IRELAND
I was wondring if someone could help me update my code to work with all tables after the third table in a Word document please? Currently all tables are updated with this code and then I manually select tables 1, 2 and 3 and change them back to their original way - which is now becoming a real burden for me.
Can anyone help please? Is there a way to say For each Table(>3)...? There is no finite end range so I don't believe I can specify a Start and an End.
Here's my code so far:
Sub Format_TEMPLATE_Tables()
Dim oTbl As Word.Table
Dim oCell As Word.Cell
For Each oTbl In ActiveDocument.Tables
For Each oCell In oTbl.Range.Cells
oCell.Range.ParagraphFormat.Alignment = wdCellAlignVerticalCenter
oCell.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft
oCell.Range.ParagraphFormat.SpaceBefore = 0
oCell.Range.Font.Name = "Calibri"
oCell.Range.Font.Size = 11
Next oCell
Next oTbl
End Sub
Thanks again!
Paul, IRELAND