【发布时间】:2014-01-31 20:22:00
【问题描述】:
最近使用 Adobe Acrobat 10 Standard 从 Win XP 升级到 Win 7。我需要正确的命令来使用 Excel 2010 VBA 打印 pdf 文件。正在使用以下有效的代码。
'acrobat executable
pdfApp="C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\AcroRd32.exe"
'remote server file
f(doctyp)="\\sorl0008\groups\ACROBAT_DATA\PS\out\600374_e.pdf"
'prints adobe pdf (ORIGINAL CODE THAT WORKED)
Shell pdfApp & " /t " & Chr(34) & f(doctyp) & Chr(34), vbNormalFocus
当我现在运行它时,一旦执行了 shell 命令,屏幕就会短暂闪烁,并且绝对没有任何反应。为什么会这样?它与 Adobe Acrobat 10 有关吗?我可以使用以下代码成功打开文件,但大多数时候我不想查看文件,只需发送到默认打印机并继续。 v = Shell(pdfApp, vbNormalFocus) '打开 adobe ActiveWorkbook.FollowHyperlink f(doctyp) '在 adobe 中打开文件
即使我打开文件然后尝试打印,我也会得到与快速屏幕闪烁相同的结果,但什么也没有。我在 Windows 7 中关闭了数据执行保护,但它仍然不起作用。有什么想法吗?
【问题讨论】:
-
Even if I open the file and then try to print I get the same result of a quick screen flash and nothing.你的意思是手动打开文件后?如果是,那么您的打印机设置可能有问题?
标签: excel shell vba pdf acrobat