A. 通过vba能不能实现从excel超链接打开pdf文件,然后让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
Sub Pout()
Dim FileSaveName$
FileSaveName = Application.GetOpenFilename(fileFilter:="Files (*.pdf), *.pdf")
On Error GoTo l
CreateObject("Wscript.Shell").Run (FileSaveName)
ShellExecute Application.hwnd, "Print", FileSaveName, vbNullString, vbNullString, 0
l:
End Sub
B. 如何在vb中打开一个PDF文件
利用AcroPDF打开并显示PDF文件。
注意:必须事先安装免费的 Adobe Reader 11.0
(1)创建一个VB6工程。在工具栏中点击鼠标右键,调出右键菜单-->部件-->Adobe Acrobat 7.0 Control Type Library 1.0-->确定