gpt4 book ai didi

php - VB Script Documents.Open 抛出 424 错误

转载 作者:行者123 更新时间:2023-12-04 06:59:27 35 4
gpt4 key购买 nike

所以我有一个 vbs 脚本:

Function test2open( sSourceFile, sPDFFile )
Dim wApp ' As Word.Application
Dim wDoc ' As Word.Document

logStream.writeline "inside test2open"
on error resume next

Set wApp = CreateObject("Word.Application")
logStream.writeline Err.Number
Err.Clear

Set wDoc = wApp.Documents.Open("c:\Windows\Temp\test.DOC")
logStream.writeline Err.Number
logStream.writeline Err.Description
logStream.writeline Err.Source

wApp.Quit WdDoNotSaveChanges
Set wApp = Nothing
End Function

我正在通过带有 cscript.exe 的 apache 调用这个 vi php exec 调用。我不打算粘贴整个内容的主脚本的要点是将 word doc 转换为 pdf。但是我的完整脚本和上面的脚本都有相同的问题。

当我坐在 Windows 框上时自己调用 vbs 脚本时,它的工作原理和我想的一样,但是当通过 apache 通过 php 远程调用时,它在 Documents.Open 调用上出错,424 错误对象需要 Microsoft VBScript 运行时错误。

同样的代码在其他 2 个 Windows 机器上正确运行,这让我认为这是某种权限问题(喜欢那些描述 MS 错误消息)。但我无法弄清楚是什么。有什么想法吗?

最佳答案

我相信我已经找到了问题的答案。问题是微软限制了办公产品自动化的使用。 Server 2008 64bit 和 office 2007 运行不佳。对我有用的解决方案是在以下位置找到的:

http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91?prof=required

如果该线程消失:

This solution is ...

・Windows 2008 Server x64

Please make this folder.

C:\Windows\SysWOW64\config\systemprofile\Desktop

・Windows 2008 Server x86

Please make this folder.

C:\Windows\System32\config\systemprofile\Desktop

关于php - VB Script Documents.Open 抛出 424 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2105534/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com