Can any one tell me how to change the direction of the text (Text direction using table) in a word table using vb please?
The reason for this been I have 25 colums/20 rows in one table and that will not fit into one page of a word document. Is there a way to "Auto fill" the table so that all rows/cols are visible ?
I'm using following coding to create a table in word.
Thanks in advance
Dim wrdDoc As Word.Document
Dim wrdSelection As Word.Selection
Dim wrdApp As Word.Application
Set wrdApp = New Word.Application
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add
wrdDoc.Select
Set wrdSelection = wrdApp.Selection
wrdDoc.Tables.Add wrdSelection.Range, NumRows:=2, NumColumns:=5
With wrdDoc.Tables(1)
.AutoFormat Format:=wdTableFormatGrid8
.Cell(1, 1).Range.InsertAfter "col-1"
.Rows(1).Shading.Texture = wdTextureVertical
.Cell(1, 2).Range.InsertAfter "col-2"
.Cell(1, 3).Range.InsertAfter "col-3"
.Cell(1, 4).Range.InsertAfter "col-4"
.Cell(1, 5).Range.InsertAfter "col-5"
End With
The reason for this been I have 25 colums/20 rows in one table and that will not fit into one page of a word document. Is there a way to "Auto fill" the table so that all rows/cols are visible ?
I'm using following coding to create a table in word.
Thanks in advance
Dim wrdDoc As Word.Document
Dim wrdSelection As Word.Selection
Dim wrdApp As Word.Application
Set wrdApp = New Word.Application
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add
wrdDoc.Select
Set wrdSelection = wrdApp.Selection
wrdDoc.Tables.Add wrdSelection.Range, NumRows:=2, NumColumns:=5
With wrdDoc.Tables(1)
.AutoFormat Format:=wdTableFormatGrid8
.Cell(1, 1).Range.InsertAfter "col-1"
.Rows(1).Shading.Texture = wdTextureVertical
.Cell(1, 2).Range.InsertAfter "col-2"
.Cell(1, 3).Range.InsertAfter "col-3"
.Cell(1, 4).Range.InsertAfter "col-4"
.Cell(1, 5).Range.InsertAfter "col-5"
End With