怎样在用VB制作 WORD 表格!请给个例子吧!多谢!! 我想把在数据库中检索到的数据 用 Word 表格的形式打印出来!怎样用VB 对word文档进行操作呀!?请大侠们执教!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用 word 做一个模版!用标签把数据按顺序一一对应导出,然后打印啊 在vb中使用vba代码,你上面那个例子的vba代码为:Sub Macro1()'' Macro1 Macro' 宏在 2004-3-19 由 lsf 录制' ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _ 3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitFixed Selection.MoveRight Unit:=wdCell Selection.Cells.Split NumRows:=2, NumColumns:=1, MergeBeforeSplit:=False Selection.MoveRight Unit:=wdCell Selection.TypeParagraph Selection.EscapeKey Selection.EscapeKey Selection.EscapeKey Selection.EscapeKey Selection.EscapeKey Selection.EscapeKey Selection.TypeBackspace Selection.TypeParagraph Selection.MoveDown Unit:=wdLine, Count:=1 Selection.TypeParagraph Selection.MoveLeft Unit:=wdCharacter, Count:=2 Selection.TypeText Text:="哈哈哈" Selection.TypeParagraph Selection.TypeText Text:="哈哈哈" Selection.TypeParagraph Selection.TypeText Text:="哈哈哈" Selection.MoveRight Unit:=wdCharacter, Count:=3 Selection.TypeText Text:="哈哈哈" Selection.TypeParagraph Selection.TypeText Text:="哈哈" Selection.TypeParagraph Selection.TypeText Text:="哈哈哈哈哈"End Sub你可以在word中先启动“录制新宏”功能,然后手动完成你要的操作,完成后停止录制,再把刚才录制好的宏打开进行编辑,分析一下里面的vba代码就可以清楚了。 VB中使用Grid++报表 VB08 TREEVIEW的问题 vb怎么比较文章相似度 如何读取MSCOMM控件缓存区中的数据? 运行exe和inputbox问题 怎样实现VB样式的MDI窗体? 如何避免出现:"当系统后台繁忙时,按任意键会弹出"this action cannot be completed because the other application is busy……“的英文 如何列印VB项目中的相关文件源代码? 读取文件夹内容?来者有分! 应用程序变成右下角的模式,向超级解霸的,谢谢了,最好给个例子程序,小生不济感激 如何在短时间内掌握这门语言 大哥们帮忙了!
Sub Macro1()
'
' Macro1 Macro
' 宏在 2004-3-19 由 lsf 录制
'
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _
3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
Selection.MoveRight Unit:=wdCell
Selection.Cells.Split NumRows:=2, NumColumns:=1, MergeBeforeSplit:=False
Selection.MoveRight Unit:=wdCell
Selection.TypeParagraph
Selection.EscapeKey
Selection.EscapeKey
Selection.EscapeKey
Selection.EscapeKey
Selection.EscapeKey
Selection.EscapeKey
Selection.TypeBackspace
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="哈哈哈"
Selection.TypeParagraph
Selection.TypeText Text:="哈哈哈"
Selection.TypeParagraph
Selection.TypeText Text:="哈哈哈"
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.TypeText Text:="哈哈哈"
Selection.TypeParagraph
Selection.TypeText Text:="哈哈"
Selection.TypeParagraph
Selection.TypeText Text:="哈哈哈哈哈"
End Sub你可以在word中先启动“录制新宏”功能,然后手动完成你要的操作,完成后停止录制,再把刚才录制好的宏打开进行编辑,分析一下里面的vba代码就可以清楚了。