View Single Post
 
Old 09-30-2014, 06:44 PM
vjc21 vjc21 is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Jun 2014
Posts: 1
vjc21 is on a distinguished road
Default Compressing pictures in Word 2010

Hi all,

I am wanting to compress pictures in word 2010 using VBA. I have already scaled the inserted pictures, but need to still reduce the overall size of the document.

I am using the below code to try and accomplish this:-

Code:
With Application.CommandBars.FindControl(ID:=6382)
    SendKeys "%A%W{Enter}"
     .Execute
End With
but the sendkeys doesn't seem to be working correctly. (Word 2010 32bit, win 7 64bit)

When I do it manually I get a different compress pictures dialog box (first attachment) verse when being called in code (older possible 2003 version), even thought they both share the same ID of 6382.

I understand that it should really be done outside of word, but the end user, due to company policies is not able to install decent graphical software to compress pictures. They have to put the picture into word as a requirement of the report that are doing, so I was hoping to do it there.

I have also changed the default compression of images in the word options so that all new documents are created with a reduced dpi, but the document is still too large.

Is there a work around in vba to achieve the same result.
Attached Images
File Type: png 2014-10-01 10_14_13-Compress Pictures.png (11.2 KB, 22 views)
File Type: png 2014-10-01 10_19_04-Compress Pictures.png (9.9 KB, 22 views)