Strange, I read that but I did not get ANY impression of anything being deleted.
quote]""you could...grab the number of rows in the current document, make a nwe document, add a table (I assume) and insert a number in the first row = other table row count + 1."
I did not understand that.
[/quote]This is EXACTLY the same as what macropod suggested.
"simply right-click on the new first row's paragraph and choose Numering > Set Numbering Value,
type in the new starting number and press OK"
In othe rwords, you have to GET a number. Now you are stating 2000, then fine, use 2000. The point being is that you need to use a number.
I simply suggested table row count + 1, because that it what it is.
2000 table row count.....
new table row count start is....2000 + 1 (2001)
I state table.row.count because unless you are
always going to stop at 2000, essentially hard-coding it, then it may be handy to be able to automate starting a new document from a table with, say, 1352 rows - i.e. a new document starting row numbering at 1353.
Or ANY number of rows. Therefore: table.rows.count + 1
I am not sure what there is to not understand.
The only reason I state 2000 rows in a Word table is that that is a LOT of rows. Excel is designed for things with rows. Word...not so much.
So, how exactly IS the numbering being done?
Code:
Sub MakeNewDoc_CountContinues()
Dim ColCount As Long
Dim rowCounter As Long
If Selection.Information(wdWithInTable) = True Then
ColCount = Selection.Tables(1).Columns.Count
rowCounter = Selection.Tables(1).Rows.Count
Else
MsgBox "Selection not in table."
Exit Sub
End If
Documents.Add
ActiveDocument.Tables.Add Range:=Selection.Range, _
numrows:=1, numcolumns:=ColCount
ActiveDocument.Tables(1).Range.Cells(1).Range.Style = "MyTableNumbering"
With ListGalleries(wdNumberGallery).ListTemplates(5).ListLevels(1)
.NumberFormat = "%1."
.StartAt = rowCounter + 1
.LinkedStyle = "MyTableNumbering"
End With
ListGalleries(wdNumberGallery).ListTemplates(5).Name = ""
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries( _
wdNumberGallery).ListTemplates(5), ContinuePreviousList:=True, ApplyTo:= _
wdListApplyToWholeList, DefaultListBehavior:=wdWord10ListBehavior
End Sub
The above assumes that a proper Style is being used - MyTableNumbering.
This gets the rows count of the current table (the one the Selection is in), creates a new document, creates a new table, applies the MyTableNumbering style, and restarts it at....table.count.row + 1.
Voila, a new document with a table continuing on the counter.
unknown