Many Thanks for a very good answer.
Senad Isanovic was telling us:
Senad Isanovic nous racontait que :
> Many Thanks for a very good answer.
>
[quoted text clipped - 6 lines]
> that the user can not easily delete this unique document number. That
> was the original reason to why I 'm adding a textbox in the footer. I
Then it is probably best to use the footer to avoid accidental deletion.
> tried also to add a little table with only one cell on the first page
> and then to read/write the unique number to that cell in my table but
[quoted text clipped - 4 lines]
>
> ActiveDocument.Tables(1).Rows(1).Cells(1).Range.Text = "INT98878-v1"
No, you cannot name tables, but, you can assign a bookmark to a table, as in
this sample code that assumes that you have already made sure that section
1 in the document has a different first page footer:
'_______________________________________
Dim tblID As Table
Dim rgeFooter As Range
Const strTableName As String = "Table_ID"
'Set the range in the footer that already has a diffrent first page footer
Set rgeFooter = ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage)
_
.Range.Paragraphs(1).Range
rgeFooter.Collapse wdCollapseStart
'Add a table in that footer and assign bookmark
Set tblID = rgeFooter.Tables.Add(rgeFooter, 1, 1)
'set width
tblID.Columns(1).Width = InchesToPoints(1.25)
ActiveDocument.Bookmarks.Add strTableName, tblID.Range
'To use the table in the bookmark
With ActiveDocument.Bookmarks(strTableName).Range.Tables(1)
.Cell(1, 1).Range.Text = "INT98878-v1"
End With
'_______________________________________

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org