Private Function MxDocument_NewDocument() As Boolean MaplexOn End Function Private Function MxDocument_OpenDocument() As Boolean MaplexOn End Function
Public Sub MaplexOn() 'This simple subroutine will change the label engine for all data frames in a map to be the maplex label engine 'You should have a maplex license enabled before running this code Dim pMxDoc As IMxDocument Dim pMaps As IMaps Dim pMap As IMap Dim index As Long Dim pAnnotateMap As IAnnotateMap Dim pApp As Application Set pMxDoc = ThisDocument Set pMaps = pMxDoc.Maps 'loop through all the maps For index = 0 To pMaps.Count - 1 Set pAnnotateMap = New esriMaplex.MaplexAnnotateMap 'cocreate a new MaplexAnnotateMap object Set pMap = pMaps.Item(index) 'get the map at the current index Set pMap.AnnotationEngine = pAnnotateMap 'set the map AnnotationEngine to be MaplexAnnotateMap 'after setting the AnnotationEngine, the Map automatically translates all labeling properties to Maplex. Next index End Sub
Here's a workaround that I found for saving the Maplex settings so that the settings carry over when opening/sharing an MXD on another computer:
1. Open a blank MXD.
2. Go to the Labeling Tool in your tool bar. On the Label drop-down, select "Use Maplex Label Engine".
3. Then, go to File - Open - navigate to where you saved the shared MXD and open your MXD.
The Maplex settings should be carried over to your MXD.
Hope this helps.