写入 Microsoft Project 文件
我需要从我公司的程序导出到 Microsoft Project。据我所知,有以下几种选择:
- 使用一种交换格式,例如 xml、mpx、mpd
- 使用 COM 对象模型和自动化来写入文件
- 购买可以写入文件的库
交换格式有问题是,当您打开它们时,它们会给您一个导入对话框,如果您想以不同的格式保存,则需要另存为,并且需要在打开它们之前选择文件格式。也就是说,这对于客户来说并不是一种顺利的体验。
自动化要求从我们的程序导出的每个人都安装 MS Project,这是不可接受的。
我能找到的唯一库是 Aspose.Tasks,它只写入 Project XML 格式。
有谁知道有什么库可以编写本机 mpp 文件吗?我看过微软的一篇文章,他们无意记录文件格式,但有一些项目查看器,所以一定有人用它做了什么? (尽管现在我想到可以使用 OleDB 提供程序来读取它)。
有人吗?写入MPP文件?
I have a requirement to export to Microsoft Project from my company's program. As far as I've seen there are a few options:
- Use one of the interchange formats, e.g. xml, mpx, mpd
- Use the COM object model and automation to write the file
- Buy a library that can write the files
The interchange formats have the problem that they will give you an import dialog when you open them, and if you want to save in a different format you need save as, and you need to select the file format before opening them. I.e. it's not a smooth experience for the customer.
Automation requires everyone who exports from our program to have MS Project installed, which is not acceptable.
The only library I could find was Aspose.Tasks which only writes into the Project XML format.
Does anyone know of any library that can write native mpp files? I've seen a post from Microsoft that they have no intention of documenting the file format, but there are some Project Viewers out there so someone must have done something with it? (Although reading from it can be done with an OleDB provider now that I think about it).
Anyone? Write MPP files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
.NET Framework 具有
Microsoft.Office.Interop.MSProject
类集。如果您的应用程序是 .NET,则可以直接使用它们,或者在 .NET 中编写 dll,然后从您的应用程序引用它。The .NET Framework has the
Microsoft.Office.Interop.MSProject
set of classes. You could use them directly if your app is .NET, or write a dll in .NET and then reference that from your app.我从来没有理由以非本机格式导入或导出项目文件,但为了好玩,我只是以 .XML 格式创建并导出了一个简单的项目。果然,当我使用用户界面打开该文件时,我必须决定是否要:
a)作为新文件打开,
b) 将数据附加到活动项目或
c) 将数据合并到活动项目中。
但是,如果我使用 VBA 语句打开该文件:
我不会被多项选择题考试所困扰。如果 FileOpenEx 提供的默认选项合适,您可以编写一个非常简单的过程来指导用户。不知道这是否能满足您的需求?
I have never had reason to import or export Project files in non-native format but for kicks I just created and exported a simple Project in .XML format. Sure enough, when I open that file using the user interface I have to decide if I want to:
a) open as a new file,
b) Append the data to the active project or
c) Merge the data into the active project.
But, if I open the file using a VBA statement:
I'm not troubled by the multiple-choice exam. If the default option provided by FileOpenEx is appropriate you could concoct a very simple procedure to which you could direct your users. I'm not sure if this meets your need?