Monday, February 11, 2008

Using OpenXML4J to Access Office Open XML Parts

In a previous blog entry, I wrote about accessing Office 2007 file properties using OpenXML4J. In this blog entry, I intend to demonstrate how easy it is to access the parts that make up an Office Open XML document in Java using OpenXML4J.

The code that uses OpenXML4J to access parts of an Office 2007 document is very straightforward and is shown next.


package marx.openxml4j;

import java.util.List;

import org.openxml4j.exceptions.InvalidFormatException;
import org.openxml4j.opc.Package;
import org.openxml4j.opc.PackageAccess;
import org.openxml4j.opc.PackagePart;

/**
* Example demonstrating how to use OpenXML4J to extract parts from Office
* 2007 formatted files (Excel, Word, and PowerPoint).
*
* For other examples and for additional background on the Office Open XML
* format see:
* <ul>
* <li><a href="http://www.openxml4j.org/Documentation/Tutorials/OPCSamples.html"
* target="_blank">OpenXML4J Tutorial</a></li>
* <li><a href="http://openxmldeveloper.org/articles/OpenXMLandJava.aspx"
* target="_blank">OpenXML and Java</a></li>
* <li><a href="http://www.ecma-international.org/news/TC45_current_work/OpenXML%20White%20Paper.pdf"
* target="_blank">Office Open XML Overview</li>
* </ul>
*/
public class OpenXML4JExample
{
/**
* Display package parts that make up the provided Office 2007 compatible file.
*
* @param aFilePathAndName Path and name of Office 2007 compatible file.
*/
public void displayPackageParts(final String aFilePathAndName)
{
try
{
Package pkg = Package.open(aFilePathAndName, PackageAccess.READ);
List<PackagePart> parts = pkg.getParts();
for ( PackagePart packagePart : parts )
{
System.out.println(" PackagePart: " + packagePart.toString() );
}
}
catch (InvalidFormatException invalidFormatEx)
{
System.err.println("Invalid format" + invalidFormatEx.getMessage());
}
}

/**
* Print a separator to stdout to delineate example file being run.
*
* @param aSeparatorTitle Title to place in separator header.
*/
public static void printSeparatorHeader(final String aSeparatorTitle)
{
System.out.println(
"-------------------------------------------------------------------");
System.out.println(
"-- " + aSeparatorTitle );
System.out.println(
"-------------------------------------------------------------------");
}

/**
* Run test showing how to extract Office 2007 format properties from a
* PowerPoint presentation, a Word document, and an Excel spreadsheet using
* the OpenXML4J library (currently in Alpha).
*
* @param aCommandLineArgs Command-line arguments.
*/
public static void main(final String[] aCommandLineArgs)
{
String officeFilePathAndName;
OpenXML4JExample me = new OpenXML4JExample();

// Example Microsoft Office 2007 PowerPoint presentation
officeFilePathAndName = "C:\\sample2007\\marx-poi.pptx";
printSeparatorHeader("PowerPoint Example: " + officeFilePathAndName);
me.displayPackageParts(officeFilePathAndName);

// Example Microsoft Office 2007 Word document
officeFilePathAndName = "C:\\sample2007\\marx-poi.docx";
printSeparatorHeader("Word Example: " + officeFilePathAndName);
me.displayPackageParts(officeFilePathAndName);

// Example Microsoft Office 2007 Excel spreadsheet
officeFilePathAndName = "C:\\sample2007\\2008Conferences.xlsx";
printSeparatorHeader("Excel Example: " + officeFilePathAndName);
me.displayPackageParts(officeFilePathAndName);
}
}


The results from running this code on the files hard-coded in the source code are shown next:


-------------------------------------------------------------------
-- PowerPoint Example: C:\sample2007\marx-poi.pptx
-------------------------------------------------------------------
PackagePart: Name: /_rels/.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /docProps/app.xml - Content Type: application/vnd.openxmlformats-officedocument.extended-properties+xml
PackagePart: Name: /docProps/core.xml - Content Type: application/vnd.openxmlformats-package.core-properties+xml
PackagePart: Name: /docProps/thumbnail.wmf - Content Type: image/x-wmf
PackagePart: Name: /ppt/_rels/presentation.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/media/image1.jpeg - Content Type: image/jpeg
PackagePart: Name: /ppt/media/image2.jpeg - Content Type: image/jpeg
PackagePart: Name: /ppt/media/image3.jpeg - Content Type: image/jpeg
PackagePart: Name: /ppt/media/image4.jpeg - Content Type: image/jpeg
PackagePart: Name: /ppt/media/image5.png - Content Type: image/png
PackagePart: Name: /ppt/media/image6.png - Content Type: image/png
PackagePart: Name: /ppt/media/image7.png - Content Type: image/png
PackagePart: Name: /ppt/media/image8.wmf - Content Type: image/x-wmf
PackagePart: Name: /ppt/notesMasters/_rels/notesMaster1.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesMasters/notesMaster1.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide1.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide10.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide11.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide12.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide13.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide14.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide15.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide16.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide17.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide18.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide19.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide2.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide20.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide21.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide22.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide23.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide24.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide25.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide26.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide27.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide28.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide29.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide3.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide30.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide31.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide32.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide33.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide34.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide35.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide36.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide37.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide4.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide5.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide6.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide7.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide8.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/_rels/notesSlide9.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/notesSlides/notesSlide1.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide10.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide11.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide12.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide13.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide14.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide15.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide16.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide17.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide18.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide19.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide2.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide20.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide21.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide22.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide23.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide24.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide25.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide26.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide27.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide28.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide29.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide3.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide30.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide31.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide32.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide33.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide34.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide35.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide36.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide37.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide4.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide5.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide6.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide7.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide8.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/notesSlides/notesSlide9.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml
PackagePart: Name: /ppt/presentation.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml
PackagePart: Name: /ppt/presProps.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.presProps+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout1.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout10.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout11.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout12.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout2.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout3.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout4.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout5.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout6.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout7.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout8.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/_rels/slideLayout9.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout1.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout10.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout11.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout12.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout2.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout3.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout4.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout5.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout6.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout7.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout8.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideLayouts/slideLayout9.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml
PackagePart: Name: /ppt/slideMasters/_rels/slideMaster1.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slideMasters/slideMaster1.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml
PackagePart: Name: /ppt/slides/_rels/slide1.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide10.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide11.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide12.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide13.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide14.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide15.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide16.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide17.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide18.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide19.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide2.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide20.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide21.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide22.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide23.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide24.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide25.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide26.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide27.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide28.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide29.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide3.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide30.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide31.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide32.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide33.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide34.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide35.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide36.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide37.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide4.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide5.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide6.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide7.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide8.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/_rels/slide9.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /ppt/slides/slide1.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide10.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide11.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide12.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide13.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide14.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide15.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide16.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide17.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide18.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide19.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide2.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide20.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide21.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide22.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide23.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide24.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide25.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide26.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide27.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide28.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide29.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide3.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide30.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide31.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide32.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide33.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide34.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide35.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide36.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide37.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide4.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide5.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide6.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide7.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide8.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/slides/slide9.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.slide+xml
PackagePart: Name: /ppt/tableStyles.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml
PackagePart: Name: /ppt/theme/theme1.xml - Content Type: application/vnd.openxmlformats-officedocument.theme+xml
PackagePart: Name: /ppt/theme/theme2.xml - Content Type: application/vnd.openxmlformats-officedocument.theme+xml
PackagePart: Name: /ppt/viewProps.xml - Content Type: application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml
-------------------------------------------------------------------
-- Word Example: C:\sample2007\marx-poi.docx
-------------------------------------------------------------------
PackagePart: Name: /_rels/.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /docProps/app.xml - Content Type: application/vnd.openxmlformats-officedocument.extended-properties+xml
PackagePart: Name: /docProps/core.xml - Content Type: application/vnd.openxmlformats-package.core-properties+xml
PackagePart: Name: /word/_rels/document.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /word/_rels/footer1.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /word/_rels/footer2.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /word/_rels/settings.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /word/document.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml
PackagePart: Name: /word/endnotes.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml
PackagePart: Name: /word/fontTable.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml
PackagePart: Name: /word/footer1.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml
PackagePart: Name: /word/footer2.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml
PackagePart: Name: /word/footnotes.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml
PackagePart: Name: /word/header1.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml
PackagePart: Name: /word/media/image1.png - Content Type: image/png
PackagePart: Name: /word/media/image2.png - Content Type: image/png
PackagePart: Name: /word/numbering.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml
PackagePart: Name: /word/settings.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml
PackagePart: Name: /word/styles.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml
PackagePart: Name: /word/theme/theme1.xml - Content Type: application/vnd.openxmlformats-officedocument.theme+xml
PackagePart: Name: /word/webSettings.xml - Content Type: application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml
-------------------------------------------------------------------
-- Excel Example: C:\sample2007\2008Conferences.xlsx
-------------------------------------------------------------------
PackagePart: Name: /_rels/.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /docProps/app.xml - Content Type: application/vnd.openxmlformats-officedocument.extended-properties+xml
PackagePart: Name: /docProps/core.xml - Content Type: application/vnd.openxmlformats-package.core-properties+xml
PackagePart: Name: /xl/_rels/workbook.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /xl/comments1.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml
PackagePart: Name: /xl/drawings/vmlDrawing1.vml - Content Type: application/vnd.openxmlformats-officedocument.vmldrawing
PackagePart: Name: /xl/printerSettings/printerSettings1.bin - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.printersettings
PackagePart: Name: /xl/sharedStrings.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml
PackagePart: Name: /xl/styles.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml
PackagePart: Name: /xl/theme/theme1.xml - Content Type: application/vnd.openxmlformats-officedocument.theme+xml
PackagePart: Name: /xl/workbook.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml
PackagePart: Name: /xl/worksheets/_rels/sheet1.xml.rels - Content Type: application/vnd.openxmlformats-package.relationships+xml
PackagePart: Name: /xl/worksheets/sheet1.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml
PackagePart: Name: /xl/worksheets/sheet2.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml
PackagePart: Name: /xl/worksheets/sheet3.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml


The parts returned via OpenXML4J will look eerily similar to the parts of the same Office 2007 Excel document when its parts are displayed using the command jar tvf as shown in the next image (click on image to see larger version).



OpenXML4J provides an easy-to-use Java API for obtaining the parts that constitute an Office 2007 file.

No comments: