1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Dim oTbl
Dim oLigTbl
Set oWordApplication = CreateObject("Word.Application")
Set oWordDocument = oWordApplication.Documents.Add
oWordDocument.Range.Style = "Normal"
oWordDocument.Range.Font.Size = 11
Set oTbl = oWordDocument.Tables.Add(oWordDocument.Range, 1, 5)
oWordDocument.Tables(1).Columns(1).PreferredWidthType = 3
oWordDocument.Tables(1).Columns(1).PreferredWidth = oWordApplication.CentimetersToPoints(2.86)
oWordDocument.Tables(1).Columns(2).PreferredWidthType = 3
oWordDocument.Tables(1).Columns(2).PreferredWidth = oWordApplication.CentimetersToPoints(0.32)
oWordDocument.Tables(1).Columns(3).PreferredWidthType = 3
oWordDocument.Tables(1).Columns(3).PreferredWidth = oWordApplication.CentimetersToPoints(6.35)
oWordDocument.Tables(1).Columns(4).PreferredWidthType = 3
oWordDocument.Tables(1).Columns(4).PreferredWidth = oWordApplication.CentimetersToPoints(6.24)
oWordDocument.Tables(1).Columns(5).PreferredWidthType = 3
oWordDocument.Tables(1).Columns(5).PreferredWidth = oWordApplication.CentimetersToPoints(2.86)
oWordDocument.Tables(1).Borders.InsideLineStyle = 1
oWordDocument.Tables(1).Borders.InsideLineWidth = 6
oWordDocument.Tables(1).Borders.OutsideLineStyle = 1
oWordDocument.Tables(1).Borders.OutsideLineWidth = 6
for i = 1 to 40
Set oLigTbl = oTbl.Rows.Add
oLigTbl.Range.Font.Bold = False
oLigTbl.Range.Font.Italic = False
oLigTbl.HeadingFormat = False
oLigTbl.Cells(1).Range.Text = i
oLigTbl.Cells(3).Range.Text = i
oLigTbl.Cells(4).Range.Text = i
next
oWordDocument.SaveAs "d:\TestWord.doc", wdFormatText
oWordApplication.Quit 0
msgbox "Terminé |
Partager