c# 检查是否为.docx或.dotx文件
internal static bool IsDocxEtc(string path)
{
string ext = Path.GetExtension(path).Substring(1);
string[] newWT = Enum.GetNames(typeof(NewWordType));
if (!newWT.Contains(ext))
{
throw new ArgumentOutOfRangeException("path的后缀名必须为.docx或.dotx");
}
return true;
}