谢谢提示,又查了一些资料,目前可以打开指定PDF文件并自动打印。但是必须自己手动关闭PDF,并且代码不会继续向下运行,ACCESS不能获得焦点继续后面的动作。
请教:
1,有办法后台打印吗?类似Excel的Application.ScreenUpdating = False?
2,打开的PDF文件有代码可以操作自动关闭吗?
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command74_Click()
Dim FileSaveName$
FileSaveName = "C:\Users\005805\Desktop\Testprint\6.pdf"
On Error GoTo l00
CreateObject("Wscript.Shell").Run (FileSaveName)
ShellExecute Me.hWnd, "print", FileSaveName, vbNullString, vbNullString, 0
MsgBox "ok"
l00:
End Sub