Thread: [Solved] Add pictures in table
View Single Post
 
Old 01-29-2023, 04:39 AM
BramGrey BramGrey is offline Windows 10 Office 2021
Novice
 
Join Date: Nov 2022
Posts: 4
BramGrey is on a distinguished road
Default

Here I am again.
Since I have a new PC and Laptop, the Macro gives an Error.
Can you give me some advice?
PC = Win 10 Pro
Laptop = Win 365

Piece of the code below. It gives an error on this part.
.Characters.First.InsertCaption _
Label:="Foto", Title:=StrTxt, _
Position:=wdCaptionPositionBelow, ExcludeLabel:=False


Code:
  'Insert the Caption on the row below the picture
        With oTbl.Cell(r + 1, c).Range
          .InsertBefore vbCr
          .Characters.First.InsertCaption _
          Label:="Foto", Title:=StrTxt, _
          Position:=wdCaptionPositionBelow, ExcludeLabel:=False
          .Characters.First = vbNullString
          .Characters.Last.Previous = vbNullString
        End With
        'Exit when we're done
        If j = .SelectedItems.Count Then Exit For
      Next
      'Add extra rows as needed
Reply With Quote