![]() |
#4
|
||||
|
||||
![]()
OK, make sure you have set the preferred width for the nested table and its column to however many inches/centimeters you require.
Then, for the cell, check the 'fit text' property. This will stop the cell expanding but may result in parts of pictures that are wider than the cell when fitted to the row height disappearing. The following macro will correct such images after they're inserted. You can select either a single cell or a whole table for processing - which means to can leave the resizing till the end. Fiddling with the 'fit text' property isn't really necessary, but it prevents the rest of the parent cell's layout being messed with before the macro is run. Code:
Sub FitPics() Dim Tbl As Table, TblCl As Cell, Cell As Cell, i As Long, sWdth As Single With Selection If .Information(wdWithInTable) = False Then Exit Sub For Each Cell In .Cells With Cell sWdth = .PreferredWidth For i = 1 To .Range.InlineShapes.Count With .Range.InlineShapes(i) .LockAspectRatio = True If .Width > sWdth Then .Width = sWdth End With Next End With For Each Tbl In Cell.Tables For Each TblCl In Tbl.Range.Cells With TblCl sWdth = .PreferredWidth For i = 1 To .Range.InlineShapes.Count With .Range.InlineShapes(i) .LockAspectRatio = True If .Width > sWdth Then .Width = sWdth End With Next End With Next Next Next End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pasting an image from another PPT file shrinks some text on the page to a smaller size. Why? | User1 | PowerPoint | 0 | 12-15-2022 08:26 AM |
![]() |
Grahamers2002 | Drawing and Graphics | 5 | 07-02-2018 04:49 PM |
userform fixed size string | Vibov | Excel | 0 | 03-07-2015 04:27 AM |
copying nested if over multiple rows where one value stays fixed | charles_cat | Excel | 1 | 01-23-2015 01:30 AM |