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-->確定