惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - 青松阳光

SharePoint 2013 & Office 365 新版本功能列表 Windows PowerShell for SharePoint Command Builder SharePoint Server 2013 RTM 开发测试虚拟机部署文档 SharePoint Reaches RTM! SharePoint 2013 Designer 去掉Design View的原因,官方有了正式的解释 Office 365 Enterprise Preview SharePoint Server 2013 Preview 新变化 SharePoint Server 2013 Preview虚拟机安装步骤文档 Office 2013 和 SharePoint 2013开发学习视频 开发自定义字段时一定要注意复合控件的ID问题 彻底解决SharePoint开发Debug中弹出的IIS Ping超时问题 推荐两本SharePoint2010开发必看的书籍 Office Web App 安装完之后发现在线查看Word或者PPT发生错误解决方案 MSDN针对SharePoint 2010提供了101个解决方案示例代码供下载 2010 Information Worker Demonstration and Evaluation Virtual Machine (SP1) 提供下载 使用XSLT和XML创建Excel Thinkpad T410 安装Windows Server 2008 R2 启用Hyper-v蓝屏故障解决方法 Visual Studio 2008 Extensions for Windows SharePoint Services 3.0(VSeWSS) 1.3版本发布 SPDisposeCheck 工具新版本发布
在SharePoint中服务器端使用Word编程模型转换PDF遇到的问题以及解决方法
青松阳光 · 2011-08-18 · via 博客园 - 青松阳光

在项目中需要将Word文档转行成PDF,其中一个解决方案是在SharePoint服务器上装上Office 2007及以上版本,服务器端代码引用Microsfot.Office.Interop.Word dllOffice编程模型调用转行API接口实现。

但是在代码执行到实例化 Microsoft.Office.Interop.Word.Application时出现了异常,见一下截图:

因为代码提升了权限,是在应用池配置的标识权限下操作word的,应用程序标识配置如下:

标识是一个普通的域账号,因此需要配置相应的DCOM启动和激活权限,我们需要打开comexp.msc进行配置,注意,如果服务器上装的是32位版本,而服务器是64位的,需要用以下方式打开DCOM配置窗口,

因为我们还会遇到第二个问题,后文会提到。见以下截图,配置标识的权限

配置完之后继续运行代码,发现实例化Microsoft.Office.Interop.Word.Application通过了,但是在返回Document对象时却返回了NULL,

我们还需要设置一下,在DOCM配置窗口中找到Word一项配置为“交互式用户”。这样就不会出错了

希望这篇博客能给大家带来帮助。此解决方案同样适用于ASP.NET应用程序。 相关权限设置请下载文档