EntityName property example

Private Sub EntityNameExample()

' This example returns the EntityName property for drawing entities.

     Dim ents As Object

     Dim ent As Object

     Dim ct As Integer

     Set ents = ActiveDocument.ModelSpace

     ct = ents.Count

     MsgBox "No. of entities = " & ct

     Set ent = ents.Item(ct)

     MsgBox "The EntityName property for the last entity is: " & ent.EntityName

End Sub