Public Sub SimpleTest()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pFL As IFeatureLayer
Set pFL = pMxDoc.FocusMap.Layer(0)
pFL.Name = "new name"
pFL.Visible = False
pMxDoc.ActiveView.Refresh
pMxDoc.UpdateContents
End Sub
I guess I was not clear in my original post. I would like to be able to change the properties of a .lyr file. It seems like I should be able to read and change the properties of a lyr file.
A layer file doesn't have any properties for you to change. The process would be to open the layer file, get the layer it contains, change that layer however you need to, replace the layer in the layer file with your updated layer, then save the layer file back out. You can use ILayerFile to access the layer file on disk.