"Word.Application")
''插入数据
Dim colloop As Integer ''列号
Dim rowloop As Integer ''行号
Dim colMax As Integer ''列数
Dim rowMax As Integer ''行数
Dim wdcell As Integer ''宽
Dim UnitEnd As Integer ''截取结束点
Dim UnitName As String ''单位名称
Dim BbDate As String ''报表期别
wdcell = 12
colMax = MyRecord.Fields.count
rowMax = MyRecord.RecordCount
WdApp.Documents.Add
''获取报表单位
UnitEnd = InStr(sBBDetail, "期别")
UnitName = Mid(sBBDetail, 1, UnitEnd - 2)
BbDate = Mid(sBBDetail, UnitEnd, Len(sBBDetail))
If MyRecord.Fields.count >= 10 Then
WdApp.ActiveDocument.PageSetup.Orientation = wdOrientLandscape
Else
WdApp.ActiveDocument.PageSetup.Orientation = wdOrientPortrait
End If
''报表名称
WdApp.Selection.Font.Bold = wdToggle
WdApp.Selection.Font.Size = 14
WdApp.Selection.TypeText (sbbmc)
WdApp.Selection.ParagraphFormat.lignment = wdAlignParagraphCenter
WdApp.Selection.Font.Bold = wdToggle
WdApp.Selection.TypeParagraph
''报表单位名称
WdApp.Selection.Font.color = wdColorBlack
WdApp.Selection.Font.Size = 11
WdApp.Selection.TypeText (UnitName)
WdApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
WdApp.Selection.TypeParagraph
''报表期别
WdApp.Selection.TypeText (BbDate)
WdApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
WdApp.Selection.TypeParagraph
WdApp.Selection.TypeParagraph
''生成列头
''wdApp.Selection.HomeKey wdLine, wdE