Seperate Inserted Pictures and Apply Caption

S

Steve Finlayson

Some time ago I thought I had this problem solved. I am wanting to insert
several pictures into a Word document from the Insert:picture:File menu,
selecting multiple pictures at one time. All the pictures are placed in the
document piled in a stack on top of each other. I need to create the macro that
will first seperate them and then place a caption under each photo.

I would also like to constrain the photos to the width of the column they are
in, thus being able to create a two column format and have 6 pictures show, 3 in
each column.

The code that I though I had from before no longer works. It is as follows:

Dim oILS As InlineShape
Dim oRg As Range

ActiveDocument.Unprotect

For Each oILS In ActiveDocument.Sections.Last _
.Range.InlineShapes
Set oRg = oILS.Range.Duplicate
With oRg
.Collapse wdCollapseEnd
.Text = vbCr & vbCr & vbCr & vbCr
.Collapse wdCollapseEnd
.Move unit:=wdCharacter, Count:=-2
.InsertCaption Label:="Figure", _
Position:=wdCaptionPositionBelow
End With
Next oILS

ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True

Any help would be most appreciated. We are currently using Word 2002.
Thanks
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top