Table indent question

M

MichaelB

I’m having a bit of trouble trying to understand how to format a tables
placement within a document. The below script has been put together (with
lots of help from others) and I’m unable to figure out how to set the table
position within the document. I have a few tables that need to be aligned to
the left (which I have done with the wdAlignRowLeft but I need to indent this
table 1.08†and I can’t seem to find the proper way to do this.

Any help would be greatly appreciated.

Sub ResizeTables()
Dim oTbl As Table
Dim iTbl As Integer
Dim oCl As Cell
Dim oRng As Range
For iTbl = ActiveDocument.Tables.Count To 1 Step -1
Set oTbl = ActiveDocument.Tables(iTbl)
Set oCl = oTbl.Cell(1, 1)
Set oRng = oCl.Range
oRng.MoveEnd Unit:=wdCharacter, Count:=-1
If oTbl.Columns.Count = 4 And oRng.Text = "Version" Then
ActiveDocument.Tables(iTbl).Rows.Alignment =
wdAlignRowLeft
ActiveDocument.Tables(iTbl).AutoFitBehavior
Behavior:=wdAutoFitFixed
ActiveDocument.Tables(iTbl).Columns.PreferredWidthType =
wdPreferredWidthPoints
ActiveDocument.Tables(iTbl).Columns(1).PreferredWidth =
InchesToPoints(0.88)
ActiveDocument.Tables(iTbl).Columns(2).PreferredWidth =
InchesToPoints(1.5)
ActiveDocument.Tables(iTbl).Columns(3).PreferredWidth =
InchesToPoints(0.94)
ActiveDocument.Tables(iTbl).Columns(4).PreferredWidth =
InchesToPoints(3#)
End If
Next iTbl
End Sub
 
H

Helmut Weber

Hi Michael,

maybe you are looking
for the leftindent property of the tables's rows, like:

Selection.Tables(1).Rows.LeftIndent = InchesToPoints(1.2)

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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