嘿伙计们现在我正在尝试在文档中的每个表的A1表格单元格中获取第一行文本,并对其应用标题样式。它不使用自动换行。
现在我有
Dim CurrentTable As Table
Dim head1 As Style, head2 As Style, head3 As Style, head4 As Style
Set head1 = ActiveDocument.Styles("Heading 1")
Set head2 = ActiveDocument.Styles("Heading 2")
Set head3 = ActiveDocument.Styles("Heading 3")
Set head4 = ActiveDocument.Styles("Heading 4")
For Each CurrentTable In ActiveDocument.Tables
With CurrentTable.Cell(1, 1)
.Range.Style = head1
End With
据推测,你的'line'是一个段落,在这种情况下使用:
.Range.Paragraphs(1).Range.Style = head1