#1
|
|||
|
|||
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 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. |
#2
|
||||
|
||||
That looks like some code I posted at: http://social.msdn.microsoft.com/For...?forum=worddev
The code isn't meant to display a dialogue; it merely sets Word's compression to 'Web' resolution (96dpi). Changing the SendKeys code to: SendKeys "%A%P{Enter}" would sets Word's compression to 'Print' resolution (200dpi). That code works for Word 2003 & earlier, but not for Word 2007 & later. Although Word 2007 & later contain the same command bar, it doesn’t work. Indeed Word 2007 & later contain two command bars with the same ID - as your post shows - but it’s only the older non-functioning one the code activates. Since there is no difference in the IDs, there is no way to control which version Word serves up. According to the VBA help file: Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Looks like Windows are not supporting this. I am trying the code as well. I need it for work as we have to get files down under a 4MB limit. I have Office 365.Would be great to have a list box UserForm with a choice of 150ppi or 95ppi. Perhaps the FindControl ID has changed?
|
#4
|
||||
|
||||
No, as discussed nearly eight years ago, it's Word that doesn't support it...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Resize multiple pictures in a Word 2010 table | JBA479 | Word VBA | 1 | 01-24-2014 08:51 PM |
How to automatically insert pictures the same size in word 2010 | mindblaster | Word | 2 | 03-07-2013 11:42 AM |
How to prevent Compressing images in Word 2010 | ramsgarla | Word | 1 | 11-21-2012 04:47 PM |
Need help compressing a document | strewart | Word | 0 | 11-05-2009 09:05 PM |
Compressing images | Fran | PowerPoint | 0 | 10-29-2009 07:18 AM |