我用BarCodeCtrl控件在word文档中,在打印的时候把打印时间用条形码打印出来,代码如下:
Private Sub oApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
ThisDocument.BarCodeCtrl1.Value = Now
ThisDocument.BarCodeCtrl1.Refresh
ThisDocument.PageSetup.Orientation = wdOrientPortrait
ThisDocument.Save
If MsgBox("真的要打印吗?", vbYesNo) = vbNo Then
Cancel = True
Else
Cancel = False
End If
End Sub
可是,每次打印的数值都不是当前时间Now,但现实的数值又是Now。怎么办?谢谢