View Single Post
 
Old 10-12-2024, 03:43 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,367
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since you say the photos are 3.5" high by 4.67" wide, simply delete the TblWdth line and change
Code:
TblWdth = .PageWidth - .LeftMargin - .RightMargin - .Gutter
ColWdth = TblWdth / NumCols
to
Code:
ColWdth = InchesToPoints(4.67)
You can also delete:
Code:
        With iShp
          .LockAspectRatio = True
          If (.Width < ColWdth) And (.Height < RwHght) Then
            .Width = ColWdth
            If .Height > RwHght Then .Height = RwHght
          End If
        End With
Then to center the table on the page and have no borders, simply add:
Code:
    oTbl.Borders.Enable = False
    oTbl.Rows.Alignment = wdAlignRowCenter
after:
Code:
Set oTbl = Selection.Tables.Add(Range:=Selection.Range, NumRows:=2, NumColumns:=NumCols)
You can then also delete:
Code:
oTbl.ConvertToText
since you'll now have a centered, borderless, table.

As for:
Code:
        .Font.Size = 12
        .Font.Name = Calibri
        .Font.Italic = False
        .Font.ColorIndex = wdBlack
        .ParagraphFormat.Alignment = wdAlignParagraphCenter
None of that is necessary. What you should be doing is changing the Caption Style to give it the desired characteristics. Then all you need instead of that code is:
Code:
          .Words(1).Font.Bold = True
          .Words(2).Font.Bold = True
to Bold 'Photograph' and the Caption #.

I have no idea why you've added:
Code:
  With Selection.Find
    .Text = ""
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindAsk
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
to the code, since it doesn't do anything meaningful.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote