I suppose it’s time to throw in the towel. I’ve been searching for this syntax all day, but to no avail.
I have multiple tables in my doc which I need to add a SEQ field to the first cell of every table in row 1.
I managed to cobble together the below, but I can’t seem to find the right syntax right before the .Fields?
Sub Macro1() Dim tb As Table For Each tb In ActiveDocument.Tables With tb.Rows(1).Cells(1) .Fields.Add Range:=Selection.Range, _ Type:=wdFieldEmpty, _ text:=”SEQ Table1 n”, _ PreserveFormatting:=True End With Next tb End Sub
Two other questions.
1) How can I add the text Table to the beginning of the SEQ field? Like in Excel, I tried to add extra quotes, but maybe Word and Excel are not the same in that respect.
So in the end, Table 1, Table 2, and so on.
2) I know I can add /r1 to the SEQ field which will make the numbering start over at 1, but in my case, the Tables and actually, Table 1.1., Table 1.2., Table 1.3., and so on
The next section will be Table 2.1., Table 2.2., Table 2.3., and so on
Any thoughts?