他の誰かがこの質問に出くわした場合に備えて、私は私の解決策を提供します。テーブルの中にテーブルを作成して、テストケース番号が左側に表示されるようにすることにしました。
Sachaの答えをモデルとして使用し、マクロレコーダーを自由に使用して、私が望むことのほとんどを実行するこのVBAマクロを思いつきました。
Sub InsertTestTable()
'
' InsertTestTable Macro
' This macro inserts a test table into the document.
'
Dim oTable As Table
Dim iTable As Table
Set oTable = ActiveDocument.Tables.Add(Selection.Range, 1, 2, _
wdWord9TableBehavior, wdAutoFitContent)
Selection.TypeText ("1.")
Selection.MoveRight
Set iTable = ActiveDocument.Tables.Add(Selection.Range, 4, 2, _
wdWord9TableBehavior, wdAutoFitContent)
iTable.Rows(1).Cells(1).Range.InsertBefore ("Setup:")
iTable.Rows(2).Cells(1).Range.InsertBefore ("Test:")
iTable.Rows(3).Cells(1).Range.InsertBefore ("Expected Response:")
iTable.Rows(4).Cells(1).Range.InsertBefore ("Restore:")
iTable.Rows(1).Cells(2).Range.Select
End Sub
今、私がする必要があるのは、私が望むようにテーブルをフォーマットし、ドキュメント内のテーブルのセットを介して番号を昇順にする方法を理解することです。