Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-11-2017, 05:54 AM
CL-FL CL-FL is offline Windows 10 Office 2003
Novice
 
Join Date: Jan 2017
Posts: 2
CL-FL is on a distinguished road
Default Formatting existing pictures in a document

I am trying to format pictures in a membership roster that I have inherited that has been created & worked on by multiple users over the years. The document is set up as a table, with the first column having the member's picture, and the other 2 columns containing personal information.



I'd like to format all the pictures to be the same size, but cannot find any way to do that to all the pictures at one time.

Also, is there some way to set that as a default for this document so that all future pictures will default to that size?

Thanks for any help!
Carol
Reply With Quote
  #2  
Old 01-11-2017, 05:31 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,095
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

If you format the table so the cell into which the pictures are to go has a fixed cell height and width, any pictures not already in the document that you insert into those cells will automatically be constrained to fit the space available.

To apply a fixed height and width:
• For the rows, set the exact row height under Table Tools>Layout>Properties>Row>Specify Height>Exactly.
• For the columns, set the preferred column width under Table Tools>Layout>Properties>Columns and uncheck the 'automatically resize to fit contents' option under Table Tools>Layout>Properties>Table>Options

Having done that for the table, the following macro with resize the existing pictures in the cells concerned.
Code:
Sub ResizePics()
Application.ScreenUpdating = False
Dim r As Long, sWdth As Single, sHght As Single
With Selection
  If .Information(wdWithInTable) = True Then
  With .Tables(1)
    With .Cell(2, 1)
      sWdth = .Width: sHght = .Height
    End With
    For r = 2 To .Rows.Count
      With .Cell(r, 1).Range
        If .InlineShapes.Count > 0 Then
          With .InlineShapes(1)
            .LockAspectRatio = True
            .Width = sWdth
            If .Height > sHght Then .Height = sHght
          End With
        End If
      End With
    Next
  End With
End With
Application.ScreenUpdating = True
End Sub
Note: the macro assumes the first fixed-dimension cell the images are to be constrained to is the first one on the second row of the selected table. If it isn't, change both instances of '2' in the code to the correct row #.

For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 01-13-2017, 05:24 AM
CL-FL CL-FL is offline Windows 10 Office 2003
Novice
 
Join Date: Jan 2017
Posts: 2
CL-FL is on a distinguished road
Default

Macropod - Thank you so much for your reply. At first, I thought this was the solution for me, and it still may be but I have another question.

In some instances, the rows are not the same height, since sometimes a member has 2 addresses (seasonal members). In that case, do I need to set the height to the greatest height needed, or can I set the height universally as you directed above, and then change it when needed?

Thanks again!
Carol
Reply With Quote
  #4  
Old 01-13-2017, 02:18 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,095
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

If you need to work with rows of varying height, replace .Height in:
sHght = .Height
with whatever number of points you need the pictures to be.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply
Please reply to this thread with any new information or opinions.

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PowerPoint Distorting/Blocking Pictures in an Already-Existing Deck Orin Albrecht PowerPoint 0 12-10-2016 08:22 PM
Help formatting Pictures inside a Text Box in Word 2013 jstumbo87 Word 2 01-29-2014 12:07 PM
Formatting Restrictions Pictures garryjunada Word 7 11-05-2013 02:25 AM
Best way to insert sub-document into existing document lsmcal1984 Word 7 08-21-2013 11:11 PM
Formatting existing text Kaila Word 0 09-03-2011 05:40 PM


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


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft