PDFファイルをページを指定して印刷する。(その2)
Adobe ReaderのCOMを使うと、どうもうまく行かないので、印刷ダイアログをSendKeysで操作します。
wShell.SendKeys "%g{tab}1-3,5{enter}"の要領でページを指定します。
Option Explicit
Dim File
Dim ie
Dim wShell
File="PDFファイルのフルパス"
Set wShell=CreateObject("WScript.Shell")
Set ie=CreateObject("InternetExplorer.Application")
ie.Visible=True
ie.Navigate File
Do While ie.Busy Or ie.ReadyState<>4
WScript.Sleep 100
Loop
ie.Document.GetVersions
ie.ExecWB 6,0
Do While Not wShell.AppActivate("印刷")
WScript.Sleep 100
Loop
wShell.SendKeys "%g{tab}1-3,5{enter}"
Do While Not wShell.AppActivate("進行状況")
WScript.Sleep 100
Loop
Do While wShell.AppActivate("進行状況")
WScript.Sleep 100
Loop
ie.Quit
« PDFファイルをページを指定して印刷する。 | トップページ | コマンドラインからタスクスケジューラのタスクを実行する。 »