Benutzer mit den meisten Antworten
C# Powerpoint Slides as Image export

Frage
Antworten
-
Hello,
for PowerPoint 2010:
in GUI: File -> Save As... -> Choose File-Type (e.g. jpg). You will be prompted if you want to save the current or all slides
in Code: If you have the 'Slide' Instance (e.g. Application.ActivePresentation.Slides[1]), you can use the 'Export' Method:
slide.Export("C:\\temp\\slide.jpg", "JPG");
OK?
mfg GP
Günter Prossliner, MSCD MSDBA- Als Antwort vorgeschlagen Elmar BoyeEditor Donnerstag, 5. August 2010 14:38
- Als Antwort markiert Robert BreitenhoferModerator Donnerstag, 19. August 2010 06:28
Alle Antworten
-
Hello,
for PowerPoint 2010:
in GUI: File -> Save As... -> Choose File-Type (e.g. jpg). You will be prompted if you want to save the current or all slides
in Code: If you have the 'Slide' Instance (e.g. Application.ActivePresentation.Slides[1]), you can use the 'Export' Method:
slide.Export("C:\\temp\\slide.jpg", "JPG");
OK?
mfg GP
Günter Prossliner, MSCD MSDBA- Als Antwort vorgeschlagen Elmar BoyeEditor Donnerstag, 5. August 2010 14:38
- Als Antwort markiert Robert BreitenhoferModerator Donnerstag, 19. August 2010 06:28
-
Hey Günter!
Thanks for your reply (Grüße von einem ehemaligen WD-Mitarbeiter)! I already found the solution.
For others: You need the following Refernces for the project:
Microsoft.Office.Core and Microsoft.Office.Interop.PowerPoint
ApplicationClass appPowerpoint = new ApplicationClass(); Presentation pres = appPowerpoint.Presentations.Open(ppFilePath, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse); foreach (Slide s in pres.Slides) { string id = Guid.NewGuid().ToString(); s.Export(Path.Combine(destinationPath, id.ToString() + ".jpg"), "jpg", imageWidth, imageHeight); }
That easy!