Altova StyleVision 2024 Enterprise Edition

Method: InsertEntity (strEntityName as String)



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




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


Unknown entry name was specified.



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

' 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)


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

End If

© 2018-2024 Altova GmbH