Link to home
Start Free TrialLog in
Avatar of firepol
firepol

asked on

heading style with messed identation

I don't know how, but Word 2003 (SP2 for office 2003 installed) added to my heading style a configruation that I never requested: identation 57 cm (?!)...

The result is that a very long title doesn't wrap. I copied an heading from the document I'm working on in a new word document (ident57sucks.doc) so that you can see it and tell me what to do in order to get rid of that stupid identation.

See "Format" > Paragraph: see indentation 57 cm... If I insert 0 I get this warning "The measurement must be betweeen -55.87 and 55.87 cm"... watf? Isnt' "0" between -55 and 55?? Word is stupid, isn't it? But here should be a workaround, I don't have time to rewrite my document from scratch because of this.

I had the same problem with heading 1 but a friend told me to copy it to a new document and copy it back... I did something like that and somehow it worked, but I can't make it work again for this one...

500 points to solve this. Please tell me what menu to click step by step in order to correct this, or alternatively save the word file corrected and give me the link. In case you give me a corrected file I consider this issue solved if I can copy the title in my working document and get the style corrected there.

Here the word document: http://www.pbworks.net/download/ident57sucks.doc
Avatar of gbahri
gbahri

Below code will help in over-riding the earlier values of Paragraph Formatting. This is probably due to the language you are using on Word. Here, Paragraph formatting unit changes to "character width" rather than pts, cm, etc. You can modify the values of .CharacterUnitLeftIndent, ChracterUnitFirstLineIndent as per your needs.
====================================================
Sub Heading4Style()
    With ActiveDocument.Styles("Heading 4")
        .AutomaticallyUpdate = True
        .BaseStyle = "Normal"
        .NextParagraphStyle = "Normal"
        .ParagraphFormat.LeftIndent = 0
        .ParagraphFormat.CharacterUnitLeftIndent = 0 ' sets a first-line indent of one character for the first paragraph in the active document
        .ParagraphFormat.CharacterUnitFirstLineIndent = -1.5  ' sets a hanging indent of 1.5 characters for the second paragraph in the active document
    End With
Dim myPara As Paragraph

For Each myPara In ActiveDocument.Paragraphs

If myPara.Range.Style = "Heading 4" Then

    Selection.Style = "Heading 4"
End If

set myPara = nothing
Next

===========================================

Thanks,

GBahri
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of firepol

ASKER

GrahamSkan: your instructions were clear, I did exactly as you told me. After adding your line in VB I could modify the identation to "0" and now the title is wrappin as I wanted. Thanks a LOT.