Assuming we have a ILayer object, I'm looking for how to get the layer description.

I mean the description text of the layer properties:

enter image description here

I didn't find it into the ArcObjects documentation.


You can access this through ILayerGeneralProperties "LayerDescription" property:

Dim pLayerFile As ILayerFile
Set pLayerFile = New LayerFile

pLayerFile.Open ("C:\Tmp\Robert.lyr")

Dim pLayer As ILayer
Set pLayer = pLayerFile.Layer

Dim pLayerGenProp As ILayerGeneralProperties
Set pLayerGenProp = pLayer

MsgBox pLayerGenProp.LayerDescription

Code courtesy of Chirag Danech

Or, if you have a MapServerLayer, Use IMapLayerInfo's "Description" property:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.