Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-12-2024, 03:43 PM
macropod's Avatar
macropod macropod is offline Photo and Caption insert macro adjustments Windows 10 Photo and Caption insert macro adjustments Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,525
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert photo reference inside callout brownees Word VBA 1 05-12-2024 04:36 PM
Modifying Macropod's Macro (Insert Multiple Images with Caption) stevenjohnson Drawing and Graphics 4 02-07-2024 09:07 AM
Photo and Caption insert macro adjustments Help to adjust photo caption macro NicB Word VBA 2 09-24-2018 11:02 AM
Word 2010 Run-Time error 4198 with Insert Picture with Caption and Fram Macro jstills116 Word VBA 0 06-24-2016 07:46 AM
Photo and Caption insert macro adjustments insert photo on top of movie wabash12 PowerPoint 2 06-14-2013 06:32 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft