Using Microsoft.Office.Interop.Word assembly

荒凉一梦 提交于 2019-11-30 18:26:19

问题


I have to do a word document programming in c#. Is there any way to access Microsoft.Office.Interop.Word assembly without installing Microsoft word? I tried to install Office Primary Interop Assemblies But it ask me install Microsoft Office package first.


回答1:


Have you tried the PIA Redistributable for whatever version of Office you are trying to work on?

The Office 2010 PIA redistributable, for example, does not list Office as a requirement (but of course that could be an error in the System Requirements section).

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=938fe8ad-583b-4bd7-a345-23250dc15855#SystemRequirements




回答2:


maybe its too late to answer... but for those who are looking for the same solution, Open XML SDK is the library Microsoft released and its used to work with office documents (doc, xls, ppt,...)




回答3:


As Dr TJ says, you could use Open XML SDK for it. We used Word.Interop but it halt sometimes, and it is not recommend for Microsoft, to use it as a server side document formatting, so Open XML SDK lets you creates word documents on DOCX and Open XML formats very easily. It lets you going well with scability, confidence ( the files, if it is corrupted can be rebuild ), and another very fine characteristics.



来源:https://stackoverflow.com/questions/6327252/using-microsoft-office-interop-word-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!