This sample demonstrates how to programmatically enable "Draw Unplaced Labels" for all the data frames in an MXD. This sample takes advantage of generic interfaces that work on both the ESRI Standard Label Engine and ESRI Maplex Label Engine, so the sample will work with or without Maplex.
How to use
- Copy and paste the sample code into the VBA Editor.
- Run the Macro.
Public Sub EnableDrawUnplacedLabels()
Dim pMxDoc As IMxDocument
Dim pMaps As IMaps
Dim pMap As IMap
Dim pMapOverposter As IMapOverposter
Dim index As Long
Dim pOverposterOptions As IOverposterOptions
Set pMxDoc = ThisDocument
Set pMaps = pMxDoc.Maps
'loop through all the maps
For index = 0 To pMaps.Count - 1
Set pMap = pMaps.Item(index) 'get the map at the current index
Set pMapOverposter = pMap
Set pOverposterOptions = pMapOverposter.OverposterProperties
pOverposterOptions.EnableDrawUnplaced = True
Next index
End Sub