Search code examples
.netvb.netms-wordoffice-interop

Compress pictures to 96 ppi (E-mail) using VB.NET?


In my project I am inserting a large amount of pictures into a Word document. After the document completes, the file size is fairly large but if I manually compress the pictures to 96 ppi the file size drops dramatically. Is there a way to do this using vb.net and word-interop?


Solution

  • Interop method AddPicture does not have resolution parameter. All it does is links to the picture file on disk and (optionally) copies it to Word document.

    So, you have to process your picture before inserting into Word by reducing its size.

    See this question on how to do this:Image resizing using C#