How can I programmatically open and save a PowerPoint presentation as HTML/JPEG in C# or Perl? -


I'm looking for a code snippet that just does this, primarily in C # or Perl.

I hope that this is not a big thing;)

In the following C: \ presentation1 will open I PPT and slide the slide to C: \ presentation1 \ slide1.jpg etc.

If you have an interop assembly If you need to get it, then it is available under 'Tools' in the office install program, or you can download it from it if you have a new version of Office, Should be able to find links for other versions.

  Using Microsoft.Office.Core; Using PowerPoint = Microsoft.Office.Interop.PowerPoint; Namespace PPInterop {class program {static zero main (string [] ARG) {var app = new PowerPoint.Application (); Var pres = app.Presentations; Var file = pres.Open (@ "C: \ Presentation 1.ppt", MsoTriState.MsoTrue, MsoTriState.MsoTrue, MsoTriState.msoFalse); File.SaveCopyAs (@ "C: \ presentation1.jpg", Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsJPG, MsoTriState.msoTrue); Edit}  Edit:  Using export is a slightly better option because you can specify the output resolution. For C #, change the last line above:  
  file.Export (@ "C: \ presentation1.jpg", "JPG", 1024, 768);  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -