Replacing numbering except for headings
Hi,
I have the following program which actually replace all the numbering in the word documents to some other symbol.
Sub ReplaceNumbers()
Dim oPara As Paragraph
Dim r As Range
For Each oPara In ActiveDocument.Paragraphs()
Set r = oPara.Range
If r.ListFormat.ListType = wdListSimpleNumbering Then
r.ListFormat.RemoveNumbers _
NumberType:=wdNumberParagraph
r.InsertBefore Text:="**"
End If
Set r = Nothing
Next
End Sub
The only addition I want in this program is to: It should work for all except the titles with heading 1.
for example if Input is:
1. Heading 1 (in heading 1 style)
1. body text 1
2. body text 2
3. normal text 3
Output should be:
1. Heading 1
** body text 1
** body text 2
** normal text 3
Only numbering and word with heading 1 style should be untouched. Earlier i was trying
ActiveDocument.ConvertNumbersToText
but it is changing the entire document numbering to text.
Thanks in advance.
|