public static OpenXmlFormat Resolve(Relationships relationships) { try { var parts = relationships.FindParts(_transitionalOpenXml.OfficeDocumentRelationshipsOfficeDocument); if (parts.Count() > 0) return OpenXmlFormat.Transitional; parts = relationships.FindParts(_strictOpenXml.OfficeDocumentRelationshipsOfficeDocument); if (parts.Count() > 0) return OpenXmlFormat.Strict; } catch (Exception e) { Logger.LogError(e); } Logger.LogError("Failed to determine the Open XML format"); return OpenXmlFormat.Unknown; }