3

I have made a numbered list in Word 2010. Each list entry has an image as well. I want to center align all images, but when I try to center align an image, the text above get centered as well.

MS Word 2010 - List with images

How can I center align images in the list without centering the text above and below.

4

Ok, here's what you do:

  1. Right click on the image and select, 'Size & Position...'
  2. Select the 'Text Wrapping' tab
  3. Select 'Top & Bottom'
  4. Select the 'Position' tab
  5. Under the 'Horizontal' section, select 'Alignment' and then select 'Centered' relative to 'Column'

Unfortunately, doing this for multiple images is problematic. Format painter won't work. Also, simply using the Macro Recorder causes problems when trying to select the image.

So, creating a VBA macro and binding it to a key would seem to be the only way forward to make this super-efficient. Here are two helpful posts in this regard:

From the first of these references, I have tested the following VBA macro. Seems to work fine!

Sub FormatMyPicture()  
   Dim myShape As Shape

   If Selection.InlineShapes.Count > 0 Then
       Set myShape = Selection.InlineShapes(1).ConvertToShape
   ElseIf Selection.ShapeRange.Count > 0 Then
       Set myShape = Selection.ShapeRange(1)
   Else
       MsgBox "Please select a picture first."
       Exit Sub
   End If

   With myShape
       .WrapFormat.Type = wdWrapTopBottom
       .WrapFormat.DistanceTop = InchesToPoints(0.2)
       .WrapFormat.DistanceBottom = InchesToPoints(0.2)
       .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
       .Left = wdShapeCenter
   End With
End Sub
| improve this answer | |
  • On more thing, how do I do the same with all other images easily? Format painter is not working here :( – LifeH2O Jan 1 '13 at 12:37
  • Yes, I was just trying that and found that format painter doesn't work. I also tried selecting multiple images but struggled with that. Lastly, tried defining a style but it seems that is problematic. This suspect this is all because the property is being set for the image and not the paragraph. Creating a macro and binding a key to it would probably be the most efficient. If I think of something else, I'll let you know. – harunahi Jan 1 '13 at 12:41
  • I just tried recording a macro, can't even do that. While recording macro I am not allowed to select an image, so no way to change its properties. – LifeH2O Jan 1 '13 at 12:48
  • A bit quicker way. Select an Image then press Alt,J,P,T,W,O,Alt,J,P,A,A,C :-| – LifeH2O Jan 1 '13 at 12:54
  • Added details on creating a macro – harunahi Jan 1 '13 at 13:31
0

To align center all inline image in MS Word:

Step 1: Press Alt+F11 to open VBA Editor

Step 2: Go to Insert then Module

Step 3: In the VBA Editor type following code snippet

Sub centerPictures()
  Dim shpIn As InlineShape, shp As Shape
  For Each shpIn In ActiveDocument.InlineShapes
    shpIn.Select
    Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
  Next shpIn
  For Each shp In ActiveDocument.Shapes
    shp.Select
    Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
  Next shp
End Sub

Step 4: Press F5 or press Run Sub to apply this change

| improve this answer | |
0

Hope this wil help someone special

Sub rezize_center_newline()

Dim i As Long
Dim shpIn As InlineShape, shp As Shape

With ActiveDocument
    For i = 1 To .InlineShapes.Count
        With .InlineShapes(i)
            .Height = InchesToPoints(4)
            .Width = InchesToPoints(5.32)
            .Range.InsertAfter Chr(13)
        End With
    Next i
    For Each shpIn In ActiveDocument.InlineShapes
        shpIn.Select
        Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    Next shpIn
    For Each shp In ActiveDocument.Shapes
        shp.Select
        Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    Next shp
End With
End Sub
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.