EXCEL VBA: How To: Script Picture Manager to shrink JPEGs ???
Esteemed Forum Participants and Lurkers:
===============================
Excel 2003 VBA under Windows 2000 Professional
We receive and publish quite a few Web documents that have pictures in them. Our WAN backbone has a severe speed restriction so we rigorously limit our document size. We always have a problem when the submitter uses a picture from a multi-mega pixel camera.
What we are doing is using MS Office Picture Manager (PM) to shrink the images. We wrote the VBA automation code using a lot of SendKeys strings and it seems to work reasonably well, but the code is really clumsy. Here are some of the things we do via SendKeys:
Paste image copied from Excel into PM
Select
Change View to single picture
File > Picture Options > Resize > Custom and set width and height
File > Picture Options > Compress
The code is loaded with messy strings and timer delays to get it to work, and we would like to clean it up for easier maintenance.
Has anyone done any Scripting or API work with Picture Manager that you could share?
Re: EXCEL VBA: How To: Script Picture Manager to shrink JPEGs ???
I have it but havent done anything with it. Let me take a look.
Re: EXCEL VBA: How To: Script Picture Manager to shrink JPEGs ???
Looks like its no programmable against with using its COM interface sice its not exposed. Probably better to use API calls that are more reliable then sendkeys.
You can download the API Viewer utility from allapi.net to help with this. You are going to need to use the FindWindow, FindWindowEx, SendMessages APIs in place of the sendkey sequence.