VBAでコマンドプロンプトたたいた結果を受け取ろう
サイトが引っ越しました。→https://scombu.com
約1秒後に自動的にリダイレクトします。切り替わらない場合はリンクをクリックしてください。
参考にさせていただきました。
officetanaka.net
Sub xpdf_pdfinfo_getInformation() Dim WSH, wExec, sCmd As String, Result As String Set WSH = CreateObject("WScript.Shell") ''(1) sCmd = "dir C:\" sCmd = "C:\Users\xxxx\Desktop\test\pdfinfo.exe C:\Users\xxxx\Desktop\test\no.pdf" ''(2) sCmd = "C:\Users\xxxx\Desktop\test\pdfinfo.exe C:\Users\xxxx\Desktop\test\password.pdf" ''(2) Set wExec = WSH.Exec("%ComSpec% /c " & sCmd) ''(3) Do While wExec.Status = 0 ''(4) DoEvents Loop Result = wExec.StdOut.ReadAll ''(5) MsgBox Result Set wExec = Nothing Set WSH = Nothing End Sub