Saving a layer file with a relative path

1151
1
07-24-2011 11:57 PM
MPickering
New Contributor
Hi there,

Is someone out there able to show me how I go about saving a shapefile in ArcMap as a layer file (.lyr) that has a relative path in vba? A bit of code would be really appreciated.

The idea is after I have run my code and output all the layer files I can move the shapefiles and their associated layer files from a local drive which I use for processing my data to another location where other people can use it.

m
0 Kudos
1 Reply
JohnHauck
Occasional Contributor II
You could go about this in a couple of different ways. One option is to set the relative base via IDataLayer.RelativeBase.

Another option is to use the Save To Layer File gp tool, it has a relitive path option. Here are some code examples on how to run a gp tool.
0 Kudos