C
carim.fam
Hi,
So far I have managed to indivudually promote or demote a line, but I
cannot generalize zhis macro to the whole document ...
Sub MacroAdjust()
Dim StrWord As String 'text being analysed
Dim NPer As Long 'number of periods
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
If InStr(Selection, ".") = 0 Then
Selection.Paragraphs.OutlinePromote
Else
StrWord = Left(Selection, InStr(Selection, " ") - 1)
NPer = UBound(Split(StrWord, ".")) - LBound(Split(StrWord, "."))
Select Case NPer
Case 2: Selection.Paragraphs.OutlineDemote
Case 3: Selection.Paragraphs.OutlineDemote
Selection.Paragraphs.OutlineDemote
End Select
End If
End Sub
Is there a way to loop through all the headings shown in the outline
view ?
Thanks in advance for your advice
Cheers
Carim
So far I have managed to indivudually promote or demote a line, but I
cannot generalize zhis macro to the whole document ...
Sub MacroAdjust()
Dim StrWord As String 'text being analysed
Dim NPer As Long 'number of periods
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
If InStr(Selection, ".") = 0 Then
Selection.Paragraphs.OutlinePromote
Else
StrWord = Left(Selection, InStr(Selection, " ") - 1)
NPer = UBound(Split(StrWord, ".")) - LBound(Split(StrWord, "."))
Select Case NPer
Case 2: Selection.Paragraphs.OutlineDemote
Case 3: Selection.Paragraphs.OutlineDemote
Selection.Paragraphs.OutlineDemote
End Select
End If
End Sub
Is there a way to loop through all the headings shown in the outline
view ?
Thanks in advance for your advice
Cheers
Carim