Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-14-2014, 07:42 AM
ChrisBrewster ChrisBrewster is offline Saving graphics using captions Windows 7 64bit Saving graphics using captions Office 2010 64bit
Advanced Beginner
Saving graphics using captions
 
Join Date: Jan 2014
Posts: 36
ChrisBrewster is on a distinguished road
Default Saving graphics using captions

I need to save the graphics in Word files, using an altered version of each figure's caption for the file name. VBA doesn't have a function like the "Save Picture As" function (on the menu when you right-click a graphic), which is how I thought I would create a macro. I hunted around and found a very good script, which is attached. It puts the figure captions in an array, saves the Word file as HTML in a new folder, deletes non-graphic files from that folder, and assigns the captions as file names for the graphic files.

This script does everything I need, except that it works only on PNG files. JPG files are saved, but with numbered file names. (The critical step for naming the file specifies the ".png" extension.) My VBA knowledge isn't good enough to modify this script. Can anyone suggest how to change it so that it detects the file type, and makes the correct caption for either JPG or PNG?

The script is in the attached file, and I found it at this link:

http://www.mrexcel.com/forum/general...le-folder.html
Attached Files
File Type: txt VBA macro - Extract Word graphics.txt (3.7 KB, 14 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving graphics using captions VBA to insert captions without appending to existing captions Marrick13 Word VBA 17 03-21-2023 07:51 PM
Saving graphics using captions Captions, self defined stresscalcs Word 9 01-29-2015 04:47 PM
Optional Captions RobertWA PowerPoint 0 02-21-2014 09:30 AM
Captions/Styles NWoffice Word 5 10-06-2011 10:26 AM
Captions dwilliams Word 0 10-07-2009 08:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft