I am adding scale text to a page layout. The code works, but the map units on the text scale still appear as miles and not feet as coded. Here is the code snippet to add scale text....
IEnvelope stEnvelope = new EnvelopeClass();
stEnvelope.PutCoords(14.1, 1.85, 15.37, 2.04);
IUID uid3 = new UIDClass();
uid3.Value = "esriCarto.ScaleText";
IScaleText pScaleText = new ScaleTextClass();
INumericFormat pNumericFormat = new NumericFormatClass();
pNumericFormat.UseSeparator = false;
pNumericFormat.RoundingValue = 2;
ITextSymbol stTextSymbol = new TextSymbolClass();
stTextSymbol.Color = pRgbColor;
stTextSymbol.Size = 10;
pScaleText.NumberFormat = pNumericFormat as INumberFormat;
pScaleText.PageUnits = esriUnits.esriInches;
pScaleText.PageUnitLabel = "inches";
//Assign the Map Units to be feet on the Text Scale
pScaleText.MapUnits = esriUnits.esriFeet;
pScaleText.MapUnitLabel = "feet";
//pScaleText.Style = esriScaleTextStyleEnum.esriScaleTextCustom;
pScaleText.Symbol = stTextSymbol;
IFrameElement stFrameElement = pGraphicsContainer.FindFrame(map);
IMapFrame stMapFrame = stFrameElement as IMapFrame;
IMapSurroundFrame StMapSurroundFrame = sbMapFrame.CreateSurroundFrame(uid3 as UID, null);
IElement stElement = StMapSurroundFrame as IElement;
stElement.Geometry = stEnvelope;
stElement.Activate(activeView.ScreenDisplay);
pGraphicsContainer.AddElement(stElement, 0);
Any coding help would be appreciated.