PDA

View Full Version : Image Insertion and Auto Caption and Grouping



sharens1
09-23-2017, 09:40 AM
I am looking for a macro, that will have the following functionality:

Clicking on Macro:
Open up my image folder C:\\desktop\pictures and allow me to select image
it will size image 4" square
Word wrap to the Right side of word document
Automatically add a caption per the style assigned
The biggest thing would be that it would group the caption and image automatically - so when I move the image, the caption goes with it.

Is this possible?

macropod
09-23-2017, 10:59 PM
To ensure the image & caption are grouped together, put both in a table - which can have text wrapping, if you want. For some code to get you started, see: http://www.vbaexpress.com/forum/showthread.php?44473-Insert-Multiple-Pictures-Into-Table-Word-With-Macro&p=306321&viewfull=1#post306321

sharens1
10-20-2017, 08:38 PM
Thanks for this.. Very helpful. I applied the VBA below, however, it does not associate the images as figures, rather sequences. As such they cannot be cross referenced. Is there a way to assoicated as figures/captions?

macropod
10-20-2017, 08:50 PM
The code in the link applies a 'Picture' caption to every image; that is what you cross-reference. All captions use SEQ fields, regardless of whether they're for equations, figures, tables or, as in my code, pictures.

sharens1
10-21-2017, 02:29 PM
Thanks you for your reply. In the cross reference, there are isn't any references to the caption. I would like to reference the figure and sequence number. (I.e.; see figure 1).
Is this possible?

macropod
10-21-2017, 02:39 PM
You might at least look in the 'Reference Type' dropdown. There you will find 'Picture'... And, quite obviously, if that's what the captions are, you can't reference them as 'Figure'. If you want to reference the captions as figures, instead of as pictures, you will have to edit the code so it uses 'Figure' captions instead of 'Picture' captions.

sharens1
10-21-2017, 05:16 PM
Might you be able to help me modify the code so it uses uses 'Figure' captions instead of 'Picture' captions.

macropod
10-21-2017, 08:42 PM
I'm sure it wouldn't take more than 30 seconds for you to find what needs changing...