且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过Windows 2008 Server上的Windows Service自动化Office

更新时间:2023-02-08 20:46:38

即使在Windows Server 2003下工作正常,我也无法从Windows Server 2008下的Windows Service中自动执行Office的问题.电话,所以可能是同样的问题.

I've had problems automating Office from a Windows Service under Windows Server 2008, even though that works fine under Windows Server 2003. The problem also occurs at the Open call, so it may be the same problem.

我尝试遵循H Ogawa在此MSDN线程,它似乎可以正常工作.这很奇怪,但是小川先生发现它很赞.

I tried following the advice given by H Ogawa in this MSDN thread, and it seemed to work. It's bizarre, but kudos to Mr. Ogawa for discovering it.

"Ogawa Hack"的摘要:为系统配置文件创建一个桌面文件夹,如下:

Summary of the 'Ogawa Hack': create a desktop folder for the system profile, as:

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

(如果在64位计算机上运行),则创建另一个 ,如下所示:

and, if running on a 64-bit machine, create another one, as:

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

此外,无论用户开车"到哪个办公室,文件夹都需要具有写权限.

Also, the folder(s) need write permission for whatever user is "driving" Office.