xtend
''dApp.Selection.Font.Bold = wdToggle
WdApp.ActiveDocument.Tables.Add WdApp.Selection.Range, rowMax, colMax
Dim i As Integer
Do
For colloop = 0 To colMax - 1
WdApp.Selection.Font.Size = 9
If i = 0 Then
''表格中标题加粗显示
WdApp.Selection.Font.Bold = wdToggle
''表格标题行背景颜色设置为灰色,灰度为30
With WdApp.Selection.Cells
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorGray30
End With
End With
End If
''最后一行右对齐,其余左对齐
If i > 0 Then
If MyRecord.Fields.Item(colloop).Name = "ZBMC" Or MyRecord.Fields.Item(colloop).Name = "指标名称" Then
WdApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft