如何利用宏记录Word打印信息
1、打开Word2007,切换到”开发工具“选项卡,然后点击“宏”按钮。

3、在打开的编辑宏窗口中,输入如图所示的代码:Sub FilePrint()'' FilePrint 宏' 打印活动文档' 肛舀辨乔Dialogs(wdDialogFilePrint).Show PrintName = ActiveDocument.Path + "" + ActiveDocument.Name If ActiveDocument.Path = "" Then PrintName = "未保存文档" End If PrintTime = Str(Date) + "日" + Str(Time) Open "d:\PrintInfo.dat" For Append As #1 Print #1, "于" + PrintTime + "打印" + PrintName Close #1 End Sub最后点击”保存“按钮。

5、在打开的宏编辑界面中输入如图所示的内容:Sub FilePrintDefault(拘七呷憎)'' FilePrintDefault 宏' 以默认方式打印当前文档' ActiveDocum髫潋啜缅ent.PrintOut PrintName = ActiveDocument.Path + "" + ActiveDocument.Name If ActiveDocument.Path = "" Then PrintName = "未保存文档" End If PrintTime = Str(Date) + "日" + Str(Time) Open "d:\PrintInfo.dat" For Append As #1 Print #1, "于" + PrintTime + "打印" + PrintName Close #1End Sub最后点击“保存"按钮。

