Quote:
Originally Posted by Shelley Lou
I still can't seem to get the second macro 'ApplyHeadingStyles_Auto' to work - it has a compile error Sub or Function not defined and highlights the word 'Undo' in the line If bLvl = False Then Undo
|
That should have been ActiveDocument.Undo. Code updated
Quote:
Originally Posted by Shelley Lou
The line .Font.Bold = Choose(i, 1, 1, 0, 0, 0, 0) was still making the heading number bold so I changed this to .Font.Bold = Choose(i, 0, 0, 0, 0, 0, 0) and that seems to have worked.
|
I did it that way to match the example you posted. Since you want all of them to not be bold, all you need is:
.Font.Bold = False
Quote:
Originally Posted by Shelley Lou
I also needed the paragraphs to have Hanging Indents. I recorded the steps first to get the values .ParagraphFormat.FirstLineIndent = InchesToPoints(-0.5) so after trying many variations I've come up with this code which seems to work.
|
All you needed to do was change:
.ParagraphFormat.FirstLineIndent = 0 'InchesToPoints(-0.5)
(which was in the code you posted), to:
.ParagraphFormat.FirstLineIndent = InchesToPoints(-0.5)
And change:
Code:
Select Case i
Case 1, 2
.ParagraphFormat.LeftIndent = 0
Case Else
.ParagraphFormat.LeftIndent = InchesToPoints((i - 2) * 0.5)
End Select
to:
Code:
Select Case i
Case 1, 2
.ParagraphFormat.LeftIndent = InchesToPoints(0.5)
Case Else
.ParagraphFormat.LeftIndent = InchesToPoints((i - 1) * 0.5)
End Select