Due to conflict with heading styles and restart numbering, the current paragraph loses its indentation.
Therefore my code checks if the selected paragraph is a specific heading. If yes then
set left indentation
set hanging indent
Code: Select all
If worddoc.Template.TemplateType = WordTemplate.TemplateTypes.Advice Then
Dim paraThis As MSWord.Paragraph
For Each paraThis In worddoc.Document.Application.Selection.Paragraphs
Dim paraStyle As MSWord.Style = CType(worddoc.Library.Application.Application.Selection.Paragraphs.Style, Microsoft.Office.Interop.Word.Style)
Dim style2 As MSWord.Style = worddoc.GetStyle("Normal")
If InStr(1, paraStyle.NameLocal, "Page 1 Para number", CompareMethod.Text) > 0 Then
paraThis.LeftIndent = (0)
paraThis.FirstLineIndent = (0.65)
End If
If InStr(1, paraStyle.NameLocal, "Page 1 (i)", CompareMethod.Text) > 0 Then
paraThis.LeftIndent = (0.65)
paraThis.FirstLineIndent = (0.85)
End If
Next
Endif
Using the code the results are for heading style "Page 1 Para number".
The paragraph formatted as:
Left indentation = 0.65cm
FirstLine = 0.02cm
Tab stops = 0.65
The results are for heading style "Page 1 Para number"
The paragraph formatted as:
Left indentation = 1.5cm
FirstLine = 0.03cm
Tab stops = -2.28cm
Im sure I had this issue in the past and cant remember the solution, as it appears Hanging indent isn't as obvious as Hanging indent
TIA dd