2009-03-11 03:03:50 UTC
I would like to get the style part of the word document.
Package pkg = Package.open(filePath, PackageAccess.READ);
PackageRelationship coreDocumentRelationship = pkg
.getRelationshipsByType(PackageRelationshipTypes.CORE_DOCUMENT)
.getRelationship(0);
PackagePart coreDocumentPart =
pkg.getPart(coreDocumentRelationship);
PackageRelationship styleRelationship =
coreDocumentPart
.getRelationshipsByType(PackageRelationshipTypes.STYLE_PART)
.getRelationship(0);
PackagePart stylePart = pkg.getPart(styleRelationship);
However, stylePart is returned as null. I know I should use PackagingURIHelper, but I don't know how to use it.
Thanks.