Examples:
The following VBA example creates a text object on each layer of the page. The text object contains the name of the corresponding layer.
Sub Test()
Dim lyr As Layer
Dim n As Long
n = 0
For Each lyr In ActivePage.Layers
lyr.CreateArtisticText 0, n, lyr.Name
n = n + 1
Next lyr
End Sub