Hanging Indent With Word Automation

J

Jonathan Wareham

Hi,

I am trying to set a hanging indent for my paragraph using the following
code ( I understand to get a hanging indent you have to pass a negative
value to the FirstLineIndent property) :

With WordApp.Selection.ParagraphFormat
' Indent
.RightIndent = WordApp.InchesToPoints(0.401574) ' 1.02cm
.FirstLineIndent = WordApp.InchesToPoints(-0.622046) ' 1.58cm
.LeftIndent = 0
' Tab Stops
.TabStops.Add WordApp.InchesToPoints(0.401574), wdAlignTabRight '
1.02cm
.TabStops.Add WordApp.InchesToPoints(0.437007), wdAlignTabLeft '
1.11cm
.TabStops.Add WordApp.InchesToPoints(7.110222), wdAlignTabRight '
18.06cm
End With

When I look at the paragraph properties window afterwards, there is a
hanging indent, but it has also set a left indent of -1.58cm - I need the
left indent to be zero.

Can anybody point out the cause of this?

Thanks,

Jonathan
 
H

Helmut Weber

Hi Jonathan,
same strange behaviour here,
nevertheless, the indent looks quite like zero
and it is zero, indeed. The dialog is wrong.
With Selection.ParagraphFormat
.LeftIndent = InchesToPoints(0)
.FirstLineIndent = InchesToPoints(-0.622046)
MsgBox .LeftIndent ' returns 0
End With
 

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