0

I want to export the slides of PowerPoint with a decent quality but not to much size. So the first thing I do for that is to add this registry key in HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\PowerPoint\Options: AutomaticPictureCompressionDefault with value 0

This is to prevent the automatic compression of images and I use this code to export the slides as images:

For Each oSlide In ActivePresentation.Slides
    sImageName = "Slide" & oSlide.SlideNumber & ".PNG"
    oSlide.Export sImagePath & sImageName, "PNG", 2048, 1536
Next oSlide

The thing is that the size is to big and I want to decrease it with a lower DPI because the size should be 2048x1536 so is not convenient to modify this. How can I set the desire DPI? Is there a way in VBA or in the registry to set the DPI value I want to use?

Iban Arriola
  • 2,526
  • 9
  • 41
  • 88
  • Why do you need to set DPI? The image would be the same no matter what. Have you done the research to determine whether PNG can even *carry* DPI information? Not all image formats can. In any case, you can't control DPI from within VBA. – Steve Rindsberg Jul 10 '14 at 14:59
  • Thanks for the answer. Yes I check on the web and there are examples for changing the DPI value to PNG images. So it is possible. Anyway if with VBA it cannot be done then it doesn't matter the image format. – Iban Arriola Jul 10 '14 at 15:15
  • If you absolutely need to change the DPI value of an image, you can export at the needed resolution then use an imaging library like FreeImage to change the saved file. – Steve Rindsberg Jul 11 '14 at 14:38

0 Answers0