className Property

Microsoft FrontPage Visual Basic

className Property

Returns or sets a String that represents the value of the class attribute of the specified object.

expression.className

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

Remarks

The class attribute typically associates an element with a particular style rule in a style sheet.

Example

The following example sets the value of the className property of the specified tag.

Function SetClassName(ByRef strClassName As String, _
        ByRef strTag As String) As Boolean

    Dim objDoc As FPHTMLDocument
    Dim intCounter As Integer
    
    Set objDoc = ActiveDocument
    
    For intCounter = 0 To objDoc.all.Length
        If objDoc.all(intCounter).tagName = strTag Then
            objDoc.all(intCounter).className = strClassName
            Exit For
        End If
    Next
    
End Function
		

Use the following example to call the preceding function.

Sub CallSetClassName()
    Call SetClassName(strClassName:="new", strTag:="body")
End Sub