Give this a run 'round the yard:
[CommandMethod("ShapeTest")]
static public void ShapeTestCommand( )
{
string shapeFileName = @"C:\Temp\Cfm.shx";
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
TextStyleTable ts = tr.GetObject(db.TextStyleTableId, OpenMode.ForWrite, false) as TextStyleTable;
TextStyleTableRecord tstr = new TextStyleTableRecord();
tstr.FileName = shapeFileName;
tstr.IsShapeFile = true;
ts.Add(tstr);
tr.AddNewlyCreatedDBObject(tstr, true);
tr.Commit();
}
}
Cheers,
Glenn.