I'm inserting some StyleRef/Seq fields into the first row of a table, but not sure how to tie the code together.
Code:
.Cell(Row:=1, Column:=1).Range.Text = "Table ?.?. Name of Table"
Code:
Sub Macro1()
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="STYLEREF ""Heading 1"" \s", PreserveFormatting:=True
End Sub
Code:
Sub Macro2()
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ Table", PreserveFormatting:=True
End Sub
I would like the above two macros to fill in in the place of the question marks in the first code block.
Also, from everything I've read, you need to use the switch \r 1 to restart the numbering in the next sequence block.
So, let's say I have four tables under Heading 1, so those tables would be 1.1., 1.2., 1.3., and 1.4.
Now under Heading 2, the table should start with 2.1. What would be the best way to handle this?
I suppose a new macro would be required, but how to recognize the first table in a new Heading section?
Code:
Sub Macro3()
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ Table \r 1", PreserveFormatting:=True
End Sub