Donate Share

OpenXML4J - Open XML library for Java

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Get style part of word document

You are viewing a single message from this topic. View all messages.

  1. 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.
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.