heading style with messed identation

Posted on 2006-05-01
Last Modified: 2010-10-05
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:
Question by:firepol
    LVL 7

    Expert Comment

    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



    LVL 76

    Accepted Solution

    The problem appears to be that there is a check on the value before it is changed.
    You can fix it with a line of VB code:

    Selection.Paragraphs.FirstLineIndent = CentimetersToPoints(1)

    To run it, put the cursor in the paragraph.
    Open the VBA editor with Alt+F11.
    Open the Immediate Window with Ctrl+G.
    Paste the code into the Immediate Window and hit Enter.

    The paragrah indent should now be within bounds.
    LVL 2

    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
    Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
    This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now