Altova XMLSpy 2025 Enterprise Edition

Method: InsertEntity (strEntityName as String)

 

Description

Replace the ranges selection with the specified entity. The specified entity must be one of the entity names returned by GetEntityNames.

 

Errors

2001

The authentic range object, or its related view object is no longer valid.

2005

Unknown entry name was specified.

 

Examples

' ---------------------------------------------------------

' Scripting environment - VBScript

' Insert the first entity in the list of available entities

' ---------------------------------------------------------

Dim objRange

' we assume that the active document is open in authentic view mode

Set objRange = Application.ActiveDocument.AuthenticView.Selection

 

' first we get the names of all available entities as they

' are shown in the entry helper of XMLSpy

Dim arrEntities

objRange.GetEntityNames arrEntities

 

' we insert the first one of the list

If UBound(arrEntities) >= 0 Then

 objRange.InsertEntity arrEntities(0)

Else

 MsgBox "Sorry, no entities are available for this document"

End If

© 2018-2024 Altova GmbH