ncssSamp Property

Microsoft FrontPage Visual Basic

ncssSamp Property

Returns or sets a Boolean that indicates whether a given text range is enclosed within a SAMP element.

expression.ncssSamp

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

Example

The following example encloses all text ranges currently within CODE elements within SAMP elements. The ranges will now appear with the formatting associated with samples.

    Sub NcssSampleTag()
 
    Dim objSs As IFPStyleState
    Dim objLine1 As IHTMLElement
    Dim strHTML As String
    
    strHTML = "<code>This is a sample that will appear with the associated sample style.</code>"
    
    Application.ActiveDocument.body.innerHTML = strHTML
    
    For Each objLine1 In Application.ActiveDocument.all.tags("code")
        Set objSs = Application.ActiveDocument.createStyleState
        objSs.gatherFromElement objLine1
        objSs.ncssSamp = True
        objSs.apply
    Next objLine1

End Sub