我的程序正在使用 office 集成和目标 windows,没有 MS Office,C#

My program is using office integrations and targetting windows without MS Office, C#

我开发了一个程序(C shrap)帮助学校存档文件,在程序中,我使用 Microsoft Word,Excel 和 Access 集成,但我不知道目标 PC 是否会有 MS office,那么,有没有办法在不要求安装 MS office 的情况下瞄准这些 PC? 我的参考: Microsoft.Office.Interop.Excel Microsoft.Office.Interop.word

如果您使用 Interop,则需要安装 office。

我建议改用其他不需要 Office 的库,例如 openxml sdk。

您可以在线找到有关如何执行此操作的各种示例。这里有几个

https://www.codingame.com/playgrounds/11047/edit-word-documents-using-openxml-and-c-without-automationinterop

https://www.codeproject.com/Articles/87711/Manipulate-Docx-with-C-without-Microsoft-Word-inst

Do we need Office Installation to work with OpenXML?

https://github.com/OfficeDev/Open-XML-SDK