Enum FileFormat

FileFormat enumeration

代表OneNote文件格式。

public enum FileFormat

价值观

姓名价值描述
Unknown0未知文件格式。
OneNote20071OneNote 2010.
OneNote20102OneNote 2010.
OneNoteOnline3OneNote Online.

例子

显示如何检查文档加载是否因不支持 OneNote 2007 格式而失败。

// 文档目录的路径。
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "OneNote2007.one");

try
{
    new Document(fileName);
}
catch (UnsupportedFileFormatException e)
{
    if (e.FileFormat == FileFormat.OneNote2007)
    {
        Console.WriteLine("It looks like the provided file is in OneNote 2007 format that is not supported.");
    }
    else
        throw;
}

也可以看看