HTMLDivision.HTMLDivisions property (Word)
Returns an HTMLDivisions object that represents an HTML division in a web document.
Syntax
expression. HTMLDivisions
expression Required. A variable that represents an 'HTMLDivision' object.
Example
This example formats three nested divisions in the active document. This example assumes that the active document is an HTML document with at least three divisions.
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
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for