![]() |
|
#1
|
|||
|
|||
![]()
Is there a way to automatically insert photo number under each photo inside a table. The word file will have multiple photos (up to 500) inside a table. Underneath each photos will be a brief comment for that photo. I am looking for a way to automatically insert photo caption like Photo 1 underneath each photo while maintaining the comment next to it. Kindly refer to the attached picture for reference.
|
#2
|
||||
|
||||
![]()
See Photo Gallery Add-in Template which will facilitate either option.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
![]()
While Graham's add-in is a logical step forward; if you just want to fix what you already have, you could try one of the following procedures:
Code:
Sub FixExisting() Dim oTbl As Table Dim oCell As Cell Dim oRng As Range Dim lngIndex As Long Set oTbl = Selection.Tables(1) lngIndex = 1 For Each oCell In oTbl.Range.Cells If oCell.Range.InlineShapes.Count = 1 Then Set oRng = oCell.Range.InlineShapes(1).Range oRng.Collapse wdCollapseEnd oRng.InsertAfter "Picture " & lngIndex lngIndex = lngIndex + 1 End If Next lbl_Exit: Exit Sub End Sub Sub FixExistingII() Dim oTbl As Table Dim oCell As Cell Dim oRng As Range Dim lngIndex As Long Set oTbl = Selection.Tables(1) lngIndex = 1 For Each oCell In oTbl.Range.Cells If oCell.Range.InlineShapes.Count = 1 Then Set oRng = oCell.Range.InlineShapes(1).Range oRng.Collapse wdCollapseEnd oRng.Move wdCharacter, 1 oRng.InsertAfter "Picture " & lngIndex & " " lngIndex = lngIndex + 1 End If Next lbl_Exit: Exit Sub End Sub |
#4
|
||||
|
||||
![]()
See the Automate the Insertion of Multiple Images into a Document 'Sticky' thread at the top of the Drawing and Graphics forum:
https://www.msofficeforums.com/drawi...-document.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
photonum |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Belinda Burton | Word VBA | 4 | 11-11-2024 12:27 PM |
![]() |
Jjansens | Word VBA | 5 | 11-18-2022 03:43 PM |
![]() |
Davidl88 | Word VBA | 6 | 09-05-2022 03:41 PM |
Insert a line with text right underneath | infinitedespair | Word | 1 | 10-28-2014 08:22 PM |
![]() |
wabash12 | PowerPoint | 2 | 06-14-2013 06:32 AM |