1,216
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Command1_Click()
Me.WindowState = vbMinimized ' 提前最小化,不打时间差;
Dim shell As Object
Set shell = CreateObject("wscript.shell")
shell.run """" & App.Path & "\cps.exe"" 500"
'CommonDialog1.ShowPrinter
rptNwind.PrintReport True
Me.WindowState = vbNormal
Unload rptNwind
End Sub
Option Explicit
Private Sub Command1_Click()
Dim shell As Object
Set shell = CreateObject("wscript.shell")
shell.run """" & App.Path & "\cps.exe"" 500"
'CommonDialog1.ShowPrinter
Me.WindowState = vbMinimized
rptNwind.PrintReport True
Me.WindowState = vbNormal
Unload rptNwind
End Sub
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Main()
Dim shell As Object
Set shell = CreateObject("wscript.shell")
Dim reg As Object
Set reg = CreateObject("vbscript.regexp")
reg.Global = True
reg.MultiLine = False
reg.ignorecase = True
reg.Pattern = "\b(\d+)\b"
If reg.test(Command()) Then
Dim objMatch As Object
Set objMatch = reg.execute(Command())(0)
Dim strCount As String
strCount = objMatch.submatches(0)
Do
DoEvents
Sleep 200
Loop While Not shell.AppActivate("打印", True)
shell.SendKeys "%c", True
shell.SendKeys strCount
End If
End Sub
Option Explicit
Private Sub Command1_Click()
Dim shell As Object
Set shell = CreateObject("wscript.shell")
shell.run """" & App.Path & "\cps.exe"" 500"
CommonDialog1.ShowPrinter
End Sub