innerText Property

Microsoft FrontPage Visual Basic

innerText Property

Sets or returns a String that represents the text between the start and end tags of a specified object without any associated HTML.

expression.innerText

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

Remarks

See also the innerHTML, outerText, and outerHTML properties.

Example

The following example changes the text inside the first <H1> tag in the active document.

    Dim objTag As IHTMLElement
    
Set objTag = ActiveDocument.all.tags("h1").Item(0)
    
objTag.innerText = "Microsoft Home Page"
  

The following example retrieves the active element in the active document, creates a String from the text contained in the active element, less any spaces, and then places a bookmark anchor, with a name attribute equal to the new String, around the text the active element contains.

    Dim objElement As IHTMLElement
Dim strElement As String
    
Set objElement = ActiveDocument.activeElement
strElement = Trim(Replace(objElement.innerText, " ", ""))

With objElement
   .innerHTML = "<A name=" & strElement & ">" & .innerHTML & "</A>"
End With