HTMLDivision.HTMLDivisionParent Method

Word Developer Reference

Returns an HTMLDivision object that represents a parent division of the current HTML division.

Syntax

expression.HTMLDivisionParent(LevelsUp)

expression   Required. A variable that represents an HTMLDivision object.

Parameters

Name Required/Optional Data Type Description
LevelsUp Optional Long The number of parent divisions to count back to return the desired division. If the LevelsUp argument is omitted, the HTML division returned is one level up from the current HTML division.

Return Value
HTMLDivision

Example

This example formats the borders for two HTML divisions in the active document. This example assumes that the active document is an HTML document with at least two divisions.

Visual Basic for Applications
  Sub FormatHTMLDivisions()
    With ActiveDocument.HTMLDivisions(1)
        With .HTMLDivisions(1)
            .LeftIndent = InchesToPoints(1)
            .RightIndent = InchesToPoints(1)
            With .Borders(wdBorderLeft)
                .Color = wdColorBlue
                .LineStyle = wdLineStyleDouble
            End With
            With .Borders(wdBorderRight)
                .Color = wdColorBlue
                .LineStyle = wdLineStyleDouble
            End With
            With .HTMLDivisionParent
                .LeftIndent = InchesToPoints(1)
                .RightIndent = InchesToPoints(1)
                With .Borders(wdBorderTop)
                    .Color = wdColorBlack
                    .LineStyle = wdLineStyleDot
                End With
                With .Borders(wdBorderBottom)
                    .Color = wdColorBlack
                    .LineStyle = wdLineStyleDot
                End With
            End With
        End With
    End With
End Sub

See Also