Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Hanging Indent With Word Automation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan Wareham - 25 Nov 2004 11:01 GMT
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
Helmut Weber - 25 Nov 2004 14:42 GMT
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
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.