compact Property

Microsoft FrontPage Visual Basic

compact Property

Returns or sets a Boolean representing whether to remove extra space between items in a specified list.

expression.compact

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

The following example inserts an ordered list into the active document and then formats the list to remove spacing between list items and to set the numbering format to capital letters.

    Sub AddSetList()
    Dim objList As FPHTMLOListElement
    
    ActiveDocument.body.insertAdjacentHTML "beforeend", "<ol id=""newlist"">" & vbCrLf & _
        "<li>item 1</li>" & vbCrLf & "<li>item 2</li>" & vbCrLf & _
        "<li>item 3</li>" & vbCrLf & "</ol>"
    
    Set objList = ActiveDocument.body.all.tags("ol").Item("newlist")
    
    With objList
        .compact = True
        .Type = "A"
    End With
End Sub