C# 以编程方式创建 PowerPoint 演示文稿
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/478838/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Creating PowerPoint presentations programmatically
提问by epotter
Is there a way to programmatically create PowerPoint presentations? If possible, I'd like to use C# and create PowerPoint 2003 presentations.
有没有办法以编程方式创建 PowerPoint 演示文稿?如果可能,我想使用 C# 并创建 PowerPoint 2003 演示文稿。
采纳答案by Spence
Yes, you can.
是的你可以。
You will want to look into MSDN which has a pretty good introduction to it.
你会想看看 MSDN,它有一个很好的介绍。
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.
我可能会警告您,Microsoft Office 互操作与现在已有 10 多年历史的 API 兼容。因此,有时使用它是非常讨厌的。如果你有钱投资一两本好书,我认为这笔钱花得值。
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.
这是您的起点。使用 MSDN MSDN 网页上的搜索功能。它适用于任何 Microsoft C# .NET 风格的东西。
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#。现在编辑链接已死:(。这两个链接与原始知识库文章非常接近:
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.
最后,对于反对这一点的人:有一天我们都在学习,作为初学者如何做某事绝对是与编程相关的,无论某人可能是多么新。
回答by user57368
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.
如果您真的不需要与 PowerPoint 兼容的输出,请考虑使用标记语言(例如 LaTeX 和 Beamer 包)来生成演示文稿的 PDF,或者以类似于Slidy的方式使用 HTML 和 javascript 。如果您需要奇特的效果,使用 SVG 可能仍然更容易,并且您可以获得可以使用免费软件可靠地查看的输出的好处。
回答by Ashutosh Singh-MVP SharePoint
http://msdn.microsoft.com/hi-in/magazine/cc163471(en-us).aspx
http://msdn.microsoft.com/hi-in/magazine/cc163471(en-us).aspx
Use this link. Although this is in VB.NET, C# supports the same.
使用此链接。尽管这是在 VB.NET 中,但 C# 支持相同。
回答by Rad
You can also look at Aspose Slides, a component for .NET and Java that makes it easy to generate powerpoint documents.
您还可以查看Aspose Slides,这是一个用于 .NET 和 Java 的组件,可以轻松生成 powerpoint 文档。
回答by Todd DeLand
回答by André van Delft
You may also try out SlideMight, a tool for merging hierarchical data with PowerPoint templates.
您还可以尝试使用SlideMight,这是一种将分层数据与 PowerPoint 模板合并的工具。
SlideMight supports:
SlideMight 支持:
- text substitution in text fields, tables and notes
- image substitution, from raw data, files and URLs
- images in tables nested
- iterations over data to create slides
- iterations to populate tables, possibly spanning multiple slides
- special formatting for specific cell values
- hyperlinks to generated slides
- 文本字段、表格和注释中的文本替换
- 图像替换,来自原始数据、文件和 URL
- 嵌套表中的图像
- 对数据进行迭代以创建幻灯片
- 填充表格的迭代,可能跨越多张幻灯片
- 特定单元格值的特殊格式
- 生成幻灯片的超链接
Input data format is at this time just JSON. There are versions for Windows and Mac OS X.
输入数据格式此时只是 JSON。有适用于 Windows 和 Mac OS X 的版本。
More information is at http://www.SlideMight.com
更多信息请访问http://www.SlideMight.com
Disclaimer:
免责声明:
I am the owner of Delftware Technology, the company that developed SlideMight. And I am one of the developers.
我是开发 SlideMight 的公司 Delftware Technology 的所有者。我是开发人员之一。
回答by Meikanda Nayanar . I
You can use Essential Presentationproduct from Syncfusion Software Private Limited. This product can be used to
您可以使用Syncfusion Software Private Limited 的Essential Presentation产品。本产品可用于
- Create and manipulate PowerPoint presentations
- Open, modify, and save existing PowerPoint presentations
- Convert PowerPoint presentations to PDF or Image
- 创建和操作 PowerPoint 演示文稿
- 打开、修改和保存现有的 PowerPoint 演示文稿
- 将 PowerPoint 演示文稿转换为 PDF 或图像
More information is at https://help.syncfusion.com/file-formats/presentation/overview
更多信息位于https://help.syncfusion.com/file-formats/presentation/overview
Disclaimer:I work for Syncfusion Software Private Limited
免责声明:我在 Syncfusion Software Private Limited 工作
回答by Jens.Huehn_at_SlideFab.com
A really simplesolution can be found in the software SlideFab 2. It requires no codingand allows it to automatically dozens and hundreds of slides within minutes (e.g. creating an Excel model and automatically creating Powerpoint slides within 2 minutes (realtime)https://slidefab.com/hello-world/).
一个非常简单的解决方案可以在软件 SlideFab 2 中找到。它不需要编码,并允许它在几分钟内自动制作数十张和数百张幻灯片(例如创建 Excel 模型并在 2 分钟内自动创建 Powerpoint 幻灯片(实时)https:// slidefab.com/hello-world/)。
SlideFab aligns windows of Excel and Powerpoint next to each other and setting it up is basically 1) selecting an Excel range, 2) selecting Powerpoint shape, 3) clicking the crosshair button of SlideFab to link it.
SlideFab 将 Excel 和 Powerpoint 的窗口彼此对齐并设置它基本上是 1) 选择 Excel 范围,2) 选择 Powerpoint 形状,3) 单击 SlideFab 的十字准线按钮以链接它。
It allows various export modes:
它允许各种导出模式:
- writing texts (with conditional formats) from Excel to Powerpoint shapes
- writing ranges or tables (with conditional formats) from Excel to Powerpoint tables
- updating Powerpoint chart ranges with Excel ranges
- copying shapes and charts from Excel to Powerpoint
- inserting images from files to Powerpoint
- inserting Excel screenshots into Powerpoint
- 将文本(带有条件格式)从 Excel 写入 Powerpoint 形状
- 将范围或表格(带条件格式)从 Excel 写入 Powerpoint 表格
- 用 Excel 范围更新 Powerpoint 图表范围
- 将形状和图表从 Excel 复制到 Powerpoint
- 将文件中的图像插入到 Powerpoint
- 将 Excel 屏幕截图插入 Powerpoint
It supports looping to create multiple custom-tailored copies of a given template presentation where each copy might can be based on different data showing different texts
它支持循环创建给定模板演示的多个定制副本,其中每个副本可能基于显示不同文本的不同数据
It has a lot more features, such as supporting Excel tables and named ranges, adding sections, creating multiple files, sorting slides based on Excel values, conditionally removing/excluding partsbased on Excel formulas and much more.
它具有更多功能,例如支持 Excel 表格和命名范围、添加部分、创建多个文件、根据 Excel 值对幻灯片进行排序、根据 Excel 公式有条件地删除/排除部分等等。
SlideFab 2 lite is available for free at https://slidefab.com/lite
SlideFab 2 lite 可在https://slidefab.com/lite免费获得
This is what it looks like creating slides:
Disclaimer:I am the developer and owner of SlideFab
免责声明:我是SlideFab的开发者和所有者