Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hanging Indent

Status
Not open for further replies.

eveCalypso

Programmer
Apr 29, 2003
134
GB
Hello All,

Is there a good and easy way to insert a hanging indent 'into a string' programmatically before doing selection.typetext?
I would like to do all string manipulations within the code.

Thank you in advance.
Regards,
EvE
 
Hi EvE,

Hanging indent is a Paragraph Format. Just record a macro of setting it how you want before typing. I just did it and got ..

Code:
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 14/05/03 by Tony Jollans
'
    With Selection.ParagraphFormat
        .LeftIndent = CentimetersToPoints(1.27)
        .RightIndent = CentimetersToPoints(0)
        .SpaceBefore = 0
        .SpaceBeforeAuto = False
        .SpaceAfter = 0
        .SpaceAfterAuto = False
        .LineSpacingRule = wdLineSpaceSingle
        .Alignment = wdAlignParagraphLeft
        .WidowControl = True
        .KeepWithNext = False
        .KeepTogether = False
        .PageBreakBefore = False
        .NoLineNumber = False
        .Hyphenation = True
        .FirstLineIndent = CentimetersToPoints(-1.27)
        .OutlineLevel = wdOutlineLevelBodyText
        .CharacterUnitLeftIndent = 0
        .CharacterUnitRightIndent = 0
        .CharacterUnitFirstLineIndent = 0
        .LineUnitBefore = 0
        .LineUnitAfter = 0
    End With
    Selection.TypeText Text:= _
        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    Selection.TypeText Text:= _
        "aaaaa s sd s s s s s s s s s s s s s s sssssssssssssssssssss"
    Selection.TypeText Text:= _
        "sssssssssssssssss s s s s s sssssssssssssssssssssss s s"
End Sub

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top