Update documents with a modified Template

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update documents with a modified Template

Post by ChrisGreaves »

Poppadon56 wrote:If you happen to find those macros to restart numbering I would appreciate it.
Please see also my Private Message.

In the meantime http://word.mvps.org/faqs/numbering/listrestartfromvba.htm
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update documents with a modified Template

Post by ChrisGreaves »

Poppadon56 wrote:If you happen to find those macros to restart numbering I would appreciate it.
Then I found my cover functions:- (But I haven't retested them today, yet)

Code: Select all

Public Sub Step()
    Call SetStyle(Selection.Range, "Step")
End Sub
Public Sub Number()
    Call SetStyle(Selection.Range, "Number")
End Sub
Public Sub Restart()
    Select Case Selection.Paragraphs(1).Style.NameLocal
        Case "Number"
            Call RestartListNumbering(Selection.Paragraphs(1).Range)
        Case "Step"
            Call RestartListNumbering(Selection.Paragraphs(1).Range)
        Case Else
    End Select
End Sub
Public Sub JoinList()
    Call UnRestartListNumbering
End Sub
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update documents with a modified Template

Post by ChrisGreaves »

http://www.chrisgreaves.com/Downloads/R ... 090805.pdf" onclick="window.open(this.href);return false;

Check out rules 46 through 74.
The TEXT rule matches strings and assigns a style. When this rules table was built I was still using List Numbering.
But recognize a level of numbering (e.g. "^p^#^#.^#^#.^#^#") and assign a unique style name. It is then a relatively simple matter to write a macro to locate all such styled paragraphs and implement, e.g., a {Seq) mechanism.

Note too that I might make several passes on a set of documents, assigning a temporary numbering style as i recognised numbers, then assigning a different style as I recognised something else. e.g. I would recognise and style paragraphs with human names in them and have the staff check the names, then re-style the paragraphs on a later pass.

See also http://www.chrisgreaves.com/DocumentConversion/" onclick="window.open(this.href);return false;

Best wishes.

i have to go out now and enjoy a bit more of my holiday ... :laugh:
There's nothing heavier than an empty water bottle