我想用 C# 打开一个 Word 文档。我的意思是我想知道如何将 Word 文档嵌入到 C# 中。
我在网上找到了一些文章,我有一个问题。这是什么意思:打开 Word 应用程序,然后添加新的。如果我打开 Word,我看不到任何“添加新”是在 C# 中吗?我正在使用 Microsoft Visual Studio 2008。
All the methods used Word automation is derived either from Word.Application or Word.Document class.
Let's consider that we want to create a document using the Word Application, we might end up doing the following steps, Open Word Application. (Opening Word Application creates a new document by default, but in Automation, wee need to manually add a document)
Add a New document.
Edit the document.
Save it
文章顺便可以在这里找到:http://www.c-sharpcorner.com/UploadFile/amrish_deep/WordAutomation05102007223934PM/WordAutomation.aspx 我想明确指出这不是作业。
最佳答案
我倾向于发现 Open XML SDK 更适合用来创建 Word 文档,因为它不需要 Word 或 Excel 的实例。
版本 2 比版本 1 好得多。
关于c# - c#生成word文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/975235/