该属性返回一个 HTMLDivisions 对象,该对象代表 Web 文档中的一个 HTML 区域。
expression.HTMLDivisions
expression 必需。该表达式返回“应用于”列表中的一个对象。
本示例设置活动文档中三个嵌套的区域的格式。本示例假定该活动文档为具有至少三个区域的 HTML 文档。
Sub FormatHTMLDivisions()
With ActiveDocument.HTMLDivisions(1)
With .Borders(wdBorderLeft)
.Color = wdColorRed
.LineStyle = wdLineStyleSingle
End With
With .Borders(wdBorderRight)
.Color = wdColorRed
.LineStyle = wdLineStyleSingle
End With
With .HTMLDivisions(1)
.LeftIndent = InchesToPoints(1)
.RightIndent = InchesToPoints(1)
With .Borders(wdBorderTop)
.Color = wdColorBlue
.LineStyle = wdLineStyleDouble
End With
With .Borders(wdBorderBottom)
.Color = wdColorBlue
.LineStyle = wdLineStyleDouble
End With
With .HTMLDivisions(1)
.LeftIndent = InchesToPoints(1)
.RightIndent = InchesToPoints(1)
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleDot
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleDot
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleDot
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleDot
End With
End With
End With
End With
End Sub