// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java // The path to the documents directory. String dataDir = Utils.getDataDir(ExtractingEmbeddedObjects.class); Project project = new Project(dataDir + "EmbeddedFile.mpp"); OleObject ole = project.getOleObjects().toList().get(0); // we have to check this property because it can be null if the embedded // object was created inside the ms project application // Or, alternatively, you can use this check: if (ole.FileFormat == // "Package") // if (!string.IsNullOrEmpty(ole.FullPath)) if (ole.getFileFormat().equals("Package")) { File file = new File(dataDir); FileOutputStream fop = new FileOutputStream(file); // get the content in bytes byte[] contentInBytes = ole.getContent(); fop.write(contentInBytes); fop.flush(); fop.close(); }