Skip to content

Commit 0414c5a

Browse files
author
Alexei Soloview
committed
Sample checking if a sample document is failed to load because of OneNote 2007 format is not supported
1 parent d704c37 commit 0414c5a

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.aspose.note.examples.load;
2+
3+
import com.aspose.note.Document;
4+
import com.aspose.note.FileFormat;
5+
import com.aspose.note.UnsupportedFileFormatException;
6+
import com.aspose.note.examples.Utils;
7+
8+
public class LoadOneNote2007 {
9+
public static void main(String[] args)
10+
{
11+
String dataDir = Utils.getSharedDataDir(LoadOneNote.class) + "load\\";
12+
13+
// ExStart:LoadOneNote2007
14+
// Load the document into Aspose.Note.
15+
try {
16+
new Document(dataDir + "OneNote2007.one");
17+
}
18+
catch (UnsupportedFileFormatException e)
19+
{
20+
if (e.getFileFormat() == FileFormat.OneNote2007)
21+
{
22+
System.out.println("It looks like the provided file is in OneNote 2007 format that is not supported.");
23+
}
24+
else
25+
throw e;
26+
}
27+
28+
// ExEnd:LoadOneNote2007
29+
}
30+
}
12.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)