用呀,你看看这些
Visual Basic 导出到 Excel 提速之法http://www.csdn.net/develop/Read_Article.asp?Id=14952
如何用vb实现将数据写入到excel和word中http://expert.csdn.net/Expert/topic/989/989863.xml?temp=.6298639http://expert.csdn.net/Expert/topic/883/883733.xml?temp=.6835749http://expert.csdn.net/Expert/topic/737/737112.xml?temp=5.511111E-02http://expert.csdn.net/Expert/topic/735/735022.xml?temp=.4253504 ecordset
vb中如何调用word进行打印http://expert.csdn.net/Expert/topic/893/893505.xml?temp=.4393732
Vb-> Word <-….-> Graphhttp://expert.csdn.net/Expert/topic/878/878671.xml?temp=.6863367
关于把数据库中的文本如何通过vb导到wordhttp://expert.csdn.net/Expert/topic/782/782970.xml?temp=.3923303
怎样将文本输出到一个word文档中(并定义在word中显示的格式(居中、粗体等))http://expert.csdn.net/Expert/topic/678/678408.xml?temp=.4987757
VB与wordhttp://expert.csdn.net/Expert/topic/662/662160.xml?temp=.4377558
高分求用EXCEL或WORD做报表的代码http://expert.csdn.net/Expert/topic/696/696732.xml?temp=.2076532
如何做这种格式的报表,而且要以这种格式存成excel文件http://expert.csdn.net/Expert/topic/1107/1107354.xml?temp=.4796411
Visual Basic 导出到 Excel 提速之法http://www.csdn.net/develop/Read_Article.asp?Id=14952
如何用vb实现将数据写入到excel和word中http://expert.csdn.net/Expert/topic/989/989863.xml?temp=.6298639http://expert.csdn.net/Expert/topic/883/883733.xml?temp=.6835749http://expert.csdn.net/Expert/topic/737/737112.xml?temp=5.511111E-02http://expert.csdn.net/Expert/topic/735/735022.xml?temp=.4253504 ecordset
vb中如何调用word进行打印http://expert.csdn.net/Expert/topic/893/893505.xml?temp=.4393732
Vb-> Word <-….-> Graphhttp://expert.csdn.net/Expert/topic/878/878671.xml?temp=.6863367
关于把数据库中的文本如何通过vb导到wordhttp://expert.csdn.net/Expert/topic/782/782970.xml?temp=.3923303
怎样将文本输出到一个word文档中(并定义在word中显示的格式(居中、粗体等))http://expert.csdn.net/Expert/topic/678/678408.xml?temp=.4987757
VB与wordhttp://expert.csdn.net/Expert/topic/662/662160.xml?temp=.4377558
高分求用EXCEL或WORD做报表的代码http://expert.csdn.net/Expert/topic/696/696732.xml?temp=.2076532
如何做这种格式的报表,而且要以这种格式存成excel文件http://expert.csdn.net/Expert/topic/1107/1107354.xml?temp=.4796411
Visual Basic 导出到 Excel 提速之法http://www.csdn.net/develop/Read_Article.asp?Id=14952
如何用vb实现将数据写入到excel和word中http://expert.csdn.net/Expert/topic/989/989863.xml?temp=.6298639
http://expert.csdn.net/Expert/topic/883/883733.xml?temp=.6835749
http://expert.csdn.net/Expert/topic/737/737112.xml?temp=5.511111E-02
http://expert.csdn.net/Expert/topic/735/735022.xml?temp=.4253504
vb中如何调用word进行打印http://expert.csdn.net/Expert/topic/893/893505.xml?temp=.4393732
Vb-> Word <-….-> Graph
http://expert.csdn.net/Expert/topic/878/878671.xml?temp=.6863367
关于把数据库中的文本如何通过vb导到word
http://expert.csdn.net/Expert/topic/782/782970.xml?temp=.3923303
怎样将文本输出到一个word文档中(并定义在word中显示的格式(居中、粗体等))
http://expert.csdn.net/Expert/topic/678/678408.xml?temp=.4987757
VB与wordh
ttp://expert.csdn.net/Expert/topic/662/662160.xml?temp=.4377558
高分求用EXCEL或WORD做报表的代码http://expert.csdn.net/Expert/topic/696/696732.xml?temp=.2076532
如何做这种格式的报表,而且要以这种格式存成excel文件http://expert.csdn.net/Expert/topic/1107/1107354.xml?temp=.4796411别忘了给分!哈哈
Screen.MousePointer = vbHourglass
On Error GoTo ErrPrint
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim nRow As Long, nCol As Long
Dim sRange As String
Set xlApp = CreateObject("Excel.Application"): xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Add: Set xlSheet = xlBook.Worksheets(1)
For nCol = 0 To RecSet.Fields.Count - 1
xlSheet.Cells(1, nCol + 1).Value = RecSet.Fields(nCol).Name
Next
xlSheet.Range(xlSheet.Cells(1, 1), xlSheet.Cells(1, RecSet.Fields.Count)).Font.Bold = True
If RecSet.BOF = False Then RecSet.MoveFirst
xlSheet.Range("A2").CopyFromRecordset RecSet
xlSheet.PrintPreview
Call CloseExcel(xlApp, xlBook, xlSheet)
Screen.MousePointer = vbDefault
Exit Sub
ErrPrint:
MsgBox "Excel报表打印不成功 !"
Call CloseExcel(xlApp, xlBook, xlSheet)
Screen.MousePointer = vbDefault
End SubPublic Sub CloseExcel(xlApp As Excel.Application, _
xlBook As Excel.Workbook,_
xlSheet As Excel.Worksheet)
On Error Resume Next
xlApp.DisplayAlerts = False
xlApp.Quit
xlApp.DisplayAlerts = True
Set xlApp = Nothing
Set xlBook = Nothing
Set xlSheet = Nothing
End Sub