0

Ive tried using several methods to save images, one was using binary code. the issue with that is that it saves a few hidden characters in the file name, and then the file becomes funky, where the only program that can open it is mspaint, and when i try to resave the file, it defaults to wanting to save the image as *heic format.

anyone have any ideas on how to save an inlineshape in Word to your desktop.

    ```
    Open strOutFileName For Binary Access Write As #1
    i = i + 1
    vData = shapeCurrent.Range.EnhMetaFileBits
    lWritePos = 1
    'put writes to the file that has been created

    Put #1, lWritePos, vData
    Close #1
    ```
  • With docx/docm files you don't need VBA - simply change the file extension to .zip, open the document as a zip archive, then extract the images. This can be automated, though. See my 'ExtractDocxMedia' macro in: https://social.msdn.microsoft.com/Forums/en-US/7a14d8dd-3165-45e0-8e01-a43ae97a1b5f/picture-cropped-while-extracting-from-word-2010-document – macropod May 03 '19 at 01:39
  • im trying to automate this as a process for a database, so manually doing this wont work for me. im trying to exactly a specific inlineshape with alternative text that identifies the correct shape in a loop. – user11166655 May 03 '19 at 15:55
  • This has been asked before and is covered in https://stackoverflow.com/questions/31922261/word-vba-how-to-save-picture-from-image-object-to-file and https://stackoverflow.com/questions/6512392/how-to-save-word-shapes-to-image-using-vba, for example. – Cindy Meister May 05 '19 at 08:50
  • Possible duplicate of [Word vba how to save picture from image object to file?](https://stackoverflow.com/questions/31922261/word-vba-how-to-save-picture-from-image-object-to-file) – Cindy Meister May 05 '19 at 08:50
  • @CindyMeister yes, ive tried both of those other solutions that have been posted, and they both dont work. one of them exports the file, but it has binary characters saved on it and the file cant be opened by anything other than ms paint. this wont work. the other solution doesnt seem to work. – user11166655 May 06 '19 at 14:29

0 Answers0