ncssNobr Property

Microsoft FrontPage Visual Basic

ncssNobr Property

Returns a Boolean that specifies that an associated range will be rendered without line breaks.

Example

The following example encloses all text ranges currently within H1 elements within NOBR elements. All ranges with the heading 1 style will no longer wrap.

Sub NoBRHeading()
'Wraps all H1 tagged ranges in Nobr tags
 
    Dim objSs As IFPStyleState
    Dim objLine1 As IHTMLElement
    Dim strHTML As String
    
    
    strHTML = "<h1>This is a sample heading that will not be wrapped</h1>"
    
    Application.ActiveDocument.body.innerHTML = strHTML
    
    For Each objLine1 In Application.ActiveDocument.all.tags("h1")
        Set objSs = Application.ActiveDocument.createStyleState
        objSs.gatherFromElement objLine1
        objSs.ncssNobr = True
        objSs.apply
    Next objLine1

End Sub