public static String getBackgroundColor( XWPFRun run ) { CTR ctr = run.getCTR(); if ( ctr == null ) { return null; } CTRPr ctrPr = ctr.getRPr(); if ( ctrPr == null ) { return null; } CTShd ctShd = ctrPr.getShd(); if ( ctShd == null ) { return null; } Attr attr = (Attr) ctShd.getDomNode().getAttributes().getNamedItemNS( "http://schemas.openxmlformats.org/wordprocessingml/2006/main", "fill" ); if ( attr != null ) { return attr.getValue(); } return null; }