Is there a way to programmatically create PowerPoint presentations? If possible, I'd like to use C# and create PowerPoint 2003 presentations.
问题:
回答1:
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.
回答2:
OpenXML looks like the way to go from a web app.
Using the interop libraries is not recommended, as others have stated.
回答3:
You can also look at Aspose Slides, a component for .NET and Java that makes it easy to generate powerpoint documents.
回答4:
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.
回答5:
http://msdn.microsoft.com/hi-in/magazine/cc163471(en-us).aspx
Use this link. Although this is in VB.NET, C# supports the same.
回答6:
You may also try out SlideMight, a tool for merging hierarchical data with PowerPoint templates.
SlideMight supports:
- 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
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.
回答7:
You can use Essential Presentation product from Syncfusion Software Private Limited. This product can be used to
- Create and manipulate PowerPoint presentations
- Open, modify, and save existing PowerPoint presentations
- Convert PowerPoint presentations to PDF or Image
More information is at https://help.syncfusion.com/file-formats/presentation/overview
Disclaimer: I work for Syncfusion Software Private Limited
回答8:
A really simple solution can be found in the software SlideFab 2. It requires no coding and 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 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.
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
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 parts based on Excel formulas and much more.
SlideFab 2 lite is available for free at https://slidefab.com/lite
This is what it looks like creating slides:
Disclaimer: I am the developer and owner of SlideFab