Save PowerPoint slides as images
Posted
by nihi_l_ist
on Stack Overflow
See other posts from Stack Overflow
or by nihi_l_ist
Published on 2010-05-21T13:50:58Z
Indexed on
2010/05/21
22:30 UTC
Read the original article
Hit count: 243
I want to save some presentation file as images into some directory and use the code:
OpenFileDialog o = new OpenFileDialog();
o.ShowDialog();
if (o.FileName != null)
{
ApplicationClass pptApplication = new ApplicationClass();
Presentation pptPresentation = pptApplication.Presentations.Open(o.FileName, MsoTriState.msoFalse,
MsoTriState.msoFalse, MsoTriState.msoFalse);
FolderBrowserDialog fb = new FolderBrowserDialog();
fb.ShowDialog();
for (int i = 0; i < pptPresentation.Slides.Count; i++)
{
pptPresentation.Slides[i].Export(fb.SelectedPath + "Slide" + (i + 1) + ".jpg", "jpg", 320, 240);
}
}
use namespaces:
using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;
But i get the following error:
'Microsoft.Office.Interop.PowerPoint.ApplicationClass' does not contain a definition for 'Presentations' and no extension method 'Presentations' accepting a first argument of type 'Microsoft.Office.Interop.PowerPoint.ApplicationClass' could be found (are you missing a using directive or an assembly reference?)
Tho it seems that it has property called Presentations..
What am i doing incorrectly?
© Stack Overflow or respective owner