View Single Post
 
Old 03-27-2023, 10:20 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

That earlier code applies styles so the hardest part is done.

You can then assign the numbering to List series of styles applied by the macro or by importing the correct style definitions from a template.

Alternatively, you could run a series of find/replaces to assign your preferred (autonumbered) styles.

Does your sample document already contain an autonumbered list outline that can be applied to the List styles?

And you can remove the manual numbers with a macro like this that works on selected paragraphs
Code:
Sub NumberingDeleteHardcoded()
  'Only acts on selected paragraphs
  Dim iResp As Integer
  iResp = MsgBox("This macro will remove all hardcoded paragraph numbers " _
    & vbCr & "from the SELECTED paragraphs. Click OK to continue.", _
    vbOKCancel, "Delete Hard Numbers")
  If iResp = vbOK Then
    WordBasic.ToolsBulletsNumbers Replace:=0, Type:=1, Remove:=1
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote