A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Align multiple tables and pics



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2007, 03:44 PM posted to microsoft.public.word.tables
clara
external usenet poster
 
Posts: 137
Default Align multiple tables and pics

Hi all,

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

Clara
--
thank you so much for your help
  #2  
Old April 17th, 2007, 10:56 AM posted to microsoft.public.word.tables
Stefan Blom
external usenet poster
 
Posts: 8,433
Default Align multiple tables and pics

Try this macro on a copy of the document:

Sub AlignAllTablesLeft()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Rows.Alignment = wdAlignRowLeft
t.Rows.LeftIndent = 0
Next t
End Sub

If you need assistance, see
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


"clara" wrote in message
...
Hi all,

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

Clara
--
thank you so much for your help






  #3  
Old April 17th, 2007, 01:44 PM posted to microsoft.public.word.tables
clara
external usenet poster
 
Posts: 137
Default Align multiple tables and pics

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
--
thank you so much for your help


"Stefan Blom" wrote:

Try this macro on a copy of the document:

Sub AlignAllTablesLeft()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Rows.Alignment = wdAlignRowLeft
t.Rows.LeftIndent = 0
Next t
End Sub

If you need assistance, see
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


"clara" wrote in message
...
Hi all,

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

Clara
--
thank you so much for your help







  #4  
Old April 17th, 2007, 09:32 PM posted to microsoft.public.word.tables
Lene Fredborg
external usenet poster
 
Posts: 1,294
Default Align multiple tables and pics

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


"clara" wrote:

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
--
thank you so much for your help


"Stefan Blom" wrote:

Try this macro on a copy of the document:

Sub AlignAllTablesLeft()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Rows.Alignment = wdAlignRowLeft
t.Rows.LeftIndent = 0
Next t
End Sub

If you need assistance, see
http://www.gmayor.com/installing_macro.htm.

--
Stefan Blom
Microsoft Word MVP


"clara" wrote in message
...
Hi all,

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

Clara
--
thank you so much for your help







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.