This is the code I use for an Add-in which uses a button to set the spatial reference, checking if the user selected a projected or geographic projections.
private ESRI.ArcGIS.Geometry.ISpatialReference3 pSR;
private void cmdSetReference_Click(System.Object sender, System.EventArgs e) {
ESRI.ArcGIS.CatalogUI.ISpatialReferenceDialog2 pSRDialog = new ESRI.ArcGIS.CatalogUI.SpatialReferenceDialog();
pSR = pSRDialog.DoModalCreate(false, false, false, My.ArcMap.Application.hWnd);
if ((pSR != null)) {
if (!pSR is ESRI.ArcGIS.Geometry.IGeographicCoordinateSystem2 & !pSR is ESRI.ArcGIS.Geometry.IProjectedCoordinateSystem5) {
System.Windows.Forms.MessageBox.Show("Please select a projected or geographic coordinate system. ", "Unknown Coordinate System", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
}
}
}