Align multiple tables and pics

C

clara

Hi all,

There are many tables ( each followed by a picture ). Is there any way to
make all these to be left aligned.

Clara
 
C

clara

Hi Stefan,

Thank you very much. Your method works very well. On my document, there are
also many pictures which I pasted from Microsoft Paint application.And also I
need to align these pictures with tables on left side. I tried to find
whether there is a collection called pictures in ActiveDocument, but I
failed. Could you help me again.

Clara
 
L

Lene Fredborg

Below you will find two macros that you may use to position the pictures. The
first macro will find all pictures (shapes) that have wrapping style "In line
with text" and align them left with 0 as the left indent. The second macro
will find all pictures (shapes) that have other wrapping styles and set their
left position to 0.

You may only need one of the macros. Note that you may need to adjust the
macro(s) - for example, if your document contains other shapes (e.g.
drawings), the macros will also manipulate their position.

Sub AlignShapesLeft_1()
'Treat pictures that are "In line with text"
Dim oShape As InlineShape
For Each oShape In ActiveDocument.InlineShapes
With oShape.Range.ParagraphFormat
.Alignment = wdAlignParagraphLeft
.LeftIndent = 0
End With
Next oShape

End Sub

Sub AlignShapesLeft_2()

'Treat pictures that are NOT "In line with text"
Dim oShape As Shape
For Each oShape In ActiveDocument.Shapes
oShape.Left = 0
Next oShape

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top