以编程方式创建 PowerPoint 演示文稿
有没有办法以编程方式创建 PowerPoint 演示文稿? 如果可能的话,我想使用 C# 并创建 PowerPoint 2003 演示文稿。
Is there a way to programmatically create PowerPoint presentations? If possible, I'd like to use C# and create PowerPoint 2003 presentations.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
是的你可以。
您需要查看 MSDN,其中对此有很好的介绍。
我可能要警告您,Microsoft Office 互操作性与已有 10 多年历史的 API 兼容。 正因为如此,有时使用起来非常令人讨厌。 如果你有钱投资一两本好书,我认为这笔钱花得值。
这是您的起点。 使用 MSDN MSDN 网页 上的搜索功能。 它适用于任何 Microsoft C# .NET 风格的东西。
具体来说,对于您的问题,此链接应该有所帮助:Automate PowerPoint from C#。 编辑链接现已失效:(。这两个链接与原始知识库文章非常接近:
Automate Powerpoint来自 C# 1/2
从 C# 自动化 Powerpoint 2/ 2
最后,对于那些对此投反对票的人:有一天我们都在学习,作为初学者如何做某件事绝对与编程相关,无论某人有多新。
Yes, you can.
You will want to look into MSDN which has a pretty good introduction to it.
I might give you a word of warning, Microsoft Office interop is compatible with an API which is now more than 10 years old. Because of this, it is downright nasty to use sometimes. If you have the money to invest in a good book or two, I think it would be money well spent.
Here's a starting point for you. Use the search feature on MSDN MSDN Webpage. It's good for any Microsoft C# .NET style stuff.
Specifically in regards to your question, this link should help: Automate PowerPoint from C#. EDIT LINK NOW DEAD :(. These two links are fairly close to the original KB article:
Automate Powerpoint from C# 1/2
Automate Powerpoint from C# 2/2
Finally, to whoever downvoted this: We were all learning one day, how to do something as a beginner is most definitely programming related, regardless of how new someone might be.
OpenXML 看起来像是从 Web 应用程序开始的方式。
正如其他人所说,不建议使用互操作库。
OpenXML looks like the way to go from a web app.
Using the interop libraries is not recommended, as others have stated.
您还可以查看 Aspose Slides,一个用于 .NET 和 Java 的组件,可以轻松生成 powerpoint 文档。
You can also look at Aspose Slides, a component for .NET and Java that makes it easy to generate powerpoint documents.
如果您确实不需要 PowerPoint 兼容输出,请考虑使用标记语言(例如带有 Beamer 包的 LaTeX)来生成演示文稿的 PDF,或者以类似于 Slidy。 如果您需要奇特的效果,使用 SVG 可能仍然更容易,并且您可以获得可以使用免费软件可靠查看的输出的好处。
If you don't really need PowerPoint compatible output, consider using a markup language such as LaTeX with the Beamer package to produce a PDF of the presentation, or use HTML and javascript in a manner similar to Slidy. If you need fancy effects, it might still be easier to use SVG, and you'd have the benefit of getting output that can be reliably viewed with free software.
http://msdn.microsoft.com/hi-in /magazine/cc163471(en-us).aspx
使用此链接。 虽然这是在 VB.NET 中,但 C# 也支持。
http://msdn.microsoft.com/hi-in/magazine/cc163471(en-us).aspx
Use this link. Although this is in VB.NET, C# supports the same.
您还可以尝试 SlideMight,这是一种将分层数据与 PowerPoint 模板合并的工具。
SlideMight 支持:
此时输入数据格式只是 JSON。
有适用于 Windows 和 Mac OS X 的版本。
更多信息请访问 http://www.SlideMight.com
< strong>免责声明:
我是 Delftware Technology 公司的所有者,该公司开发了 SlideMight。
我是开发人员之一。
You may also try out SlideMight, a tool for merging hierarchical data with PowerPoint templates.
SlideMight supports:
Input data format is at this time just JSON.
There are versions for Windows and Mac OS X.
More information is at http://www.SlideMight.com
Disclaimer:
I am the owner of Delftware Technology, the company that developed SlideMight.
And I am one of the developers.