在word文档中添加Button进行打印? [英] add Button in word document to print?

查看:67
本文介绍了在word文档中添加Button进行打印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我想在Word文档中添加两个按钮用于打印文档和关闭文档的第一个按钮,用于关闭文档的第二个按钮,我创建新的word文档和打开设计模式并添加我需要的按钮但我发现在按钮后面在事件点击代码VB和我不知道代码打印文件或关闭它所以任何人可以帮助我?

hi every body i want to add Two button in Word document first button for printing document and close document ,second button for just closing document , i make new word document and Open design mode and add buttons i need but i found behind button in the event-click code VB and i don't know code print document or close it so can anyone Help Me?

推荐答案

VBA



*打印:

ActiveDocument.PrintOut范围:= wdPrintCurrentPage



*关闭:

以下示例关闭名为Report.doc的文档而不保存更改:

Documents(Report.doc)。关闭SaveChanges:= wdDoNotSaveChanges



Best,

C
in VBA:

* print:
ActiveDocument.PrintOut Range:=wdPrintCurrentPage

* close:
The following example closes the document named "Report.doc" without saving changes:
Documents("Report.doc").Close SaveChanges:=wdDoNotSaveChanges

Best,
C


看看这里:

如何:以编程方式打印文档 [ ^ ]

如何:以编程方式关闭文档 [ ^ ]
Have a look here:
How to: Programmatically Print Documents[^]
How to: Programmatically Close Documents[^]


这篇关于在word文档中添加Button进行打印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆