I am trying to write a macro to change some table settings. It's sorta working, but I could use a little help.
1. I can't figure out how to select the first row of the current table so I can set the font and flag it as a header row.
As I understand it, this code selects the second row in the first table of a document:
Code:
ActiveDocument.Tables(1).Rows(2).Select
Can I then use this code to select the first row in the table where the cursor is?
Code:
Selection.Tables(1).Rows(1).Select
I am also using this code to ensure that the cursor is actually in a table.
Code:
If Selection.Information(wdWithInTable) <> True Then
MsgBox "The cursor is not in a table", , "MyTableSettings macro"
Exit Sub
End If