Results 1 to 3 of 3

Thread: EXCEL VBA: How To: Script Picture Manager to shrink JPEGs ???

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Question 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?
    Last edited by Webtest; Feb 14th, 2006 at 11:38 AM. Reason: Op sys Win 2k Pro
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width