Try the following code:
RasterSupport.Unlock(RasterSupportType.Document, "XXXXXXXX");
AnnAutomationManager automationManager ;
RasterCodecs codecs = null;
AnnAutomationObject annAutomationObj;
automationManager = new AnnAutomationManager();
automationManager.RasterCodecs = codecs;
automationManager.RedactionRealizePassword = String.Empty;
automationManager.UseXPStyleToolBar = true; // enable 14.5 new XP style toolbar -- must be called CreateDefaultObjects();
automationManager.CreateDefaultObjects();
for (int idx = 0; idx < automationManager.Objects.Count; idx++)
{
annAutomationObj = automationManager.Objects[idx];
if ((annAutomationObj.Id == AnnAutomationManager.RulerObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.PolyRulerObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.ProtractorObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.StampObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.AudioObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.ButtonObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.CrossProductObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.HotspotObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.FreehandHotspotObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.PointObjectId) ||
(annAutomationObj.Id == AnnAutomationManager.RubberStampObjectId)
)
{
automationManager.Objects.Remove(annAutomationObj);
}
}
automationManager.CreateToolBar();
Controls.Add(automationManager.ToolBar);
}
}