public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }