注册 登录
编程论坛 VB6论坛

VB程序内嵌 word 示例代码

hmj0745 发布于 2022-06-02 21:15, 2429 次点击
刚回复做了一个示例, 干脆发个贴子吧。
做VB程序如果需要用到打印,也许能给需要的朋友一个参考。
大神略过啊,我只是一个初学者而已。

只有本站会员才能查看附件,请 登录


工程引用
只有本站会员才能查看附件,请 登录
4 回复
#2
yuma2022-06-03 13:06
需要电脑安装 安装版本的office才能正常运行,我的绿色版Office软件表示用不了。
#3
chen35232022-06-04 20:27
在一楼的基础上,增加
Private Sub Com_print_Click()
Dim Wdapp As Word.Application
Dim Wddoc As Word.Document
  Set Wdapp = CreateObject("word.Application")    '创建word程序,打开word
  Set Wddoc = Wdapp.Documents.Add                '在word中添加一个新文档
  With Wdapp
       .Visible = True
       .Activate
       Wddoc.Range.InsertAfter Text1.Text
  End With
  Set Wdapp = Nothing        '清除word对象
  Set Wddoc = Nothing
End Sub
#4
sssooosss2022-06-07 08:55
共同学习
#5
nmcfbgttyl2022-08-09 22:01
这个太好了!
1