StyleDescription style = document.getStyleSheet().getStyleDescription(p.getStyleIndex()); TagAndStyle tas = buildParagraphTagAndStyle( style.getName(), (parentTableLevel>0) );
StyleDescription style = document.getStyleSheet().getStyleDescription(p.getStyleIndex()); if (style != null && style.getName() != null && style.getName().length() > 0) { if (p.isInList()) { numbering = listManager.getFormattedNumber(p); tas = buildParagraphTagAndStyle(style.getName(), (parentTableLevel > 0)); } else { tas = new TagAndStyle("p", null);
Range r = document.getRange(); for(int i=0; i<r.numParagraphs(); i++) { Paragraph p = r.getParagraph(i); String text = p.getText(); if( ! text.contains("What I'm Looking For")) { // Try the next paragraph continue; } if (document.getStyleSheet().numStyles()>p.getStyleIndex()) { StyleDescription style = document.getStyleSheet().getStyleDescription(p.getStyleIndex()); String styleName = style.getName(); System.out.println(styleName + " -> " + text); } else { // Text has an unknown or invalid style } }
Paragraph paragraph = range.getParagraph(i); String styleName = stylesheet.getStyleDescription(paragraph.getStyleIndex()).getName();
Paragraph paragraph = range.getParagraph(i); String styleName = stylesheet.getStyleDescription(paragraph.getStyleIndex()).getName();
private void dumpStyles() { if ( _doc instanceof HWPFOldDocument ) { System.out.println( "Word 95 not supported so far" ); return; } HWPFDocument hwpfDocument = (HWPFDocument) _doc; for ( int s = 0; s < hwpfDocument.getStyleSheet().numStyles(); s++ ) { StyleDescription styleDescription = hwpfDocument.getStyleSheet() .getStyleDescription( s ); if ( styleDescription == null ) continue; System.out.println( "=== Style #" + s + " '" + styleDescription.getName() + "' ===" ); System.out.println( styleDescription ); if ( styleDescription.getPAPX() != null ) dumpSprms( new SprmIterator( styleDescription.getPAPX(), 2 ), "Style's PAP SPRM: " ); if ( styleDescription.getCHPX() != null ) dumpSprms( new SprmIterator( styleDescription.getCHPX(), 0 ), "Style's CHP SPRM: " ); } }
private void dumpStyles() { if ( _doc instanceof HWPFOldDocument ) { System.out.println( "Word 95 not supported so far" ); return; } HWPFDocument hwpfDocument = (HWPFDocument) _doc; for ( int s = 0; s < hwpfDocument.getStyleSheet().numStyles(); s++ ) { StyleDescription styleDescription = hwpfDocument.getStyleSheet() .getStyleDescription( s ); if ( styleDescription == null ) continue; System.out.println( "=== Style #" + s + " '" + styleDescription.getName() + "' ===" ); System.out.println( styleDescription ); if ( styleDescription.getPAPX() != null ) dumpSprms( new SprmIterator( styleDescription.getPAPX(), 2 ), "Style's PAP SPRM: " ); if ( styleDescription.getCHPX() != null ) dumpSprms( new SprmIterator( styleDescription.getCHPX(), 0 ), "Style's CHP SPRM: " ); } }
String styleName = paragraphStyle.getName(); if (styleName.startsWith ("Heading"))
StyleDescription style = document.getStyleSheet().getStyleDescription(p.getStyleIndex()); if (style != null && style.getName() != null && style.getName().length() > 0) { if (p.isInList()) { numbering = listManager.getFormattedNumber(p); tas = buildParagraphTagAndStyle(style.getName(), (parentTableLevel > 0)); } else { tas = new TagAndStyle("p", null);
StyleDescription style = document.getStyleSheet().getStyleDescription(p.getStyleIndex()); if (style != null && style.getName() != null && style.getName().length() > 0) { if (p.isInList()) { numbering = listManager.getFormattedNumber(p); tas = buildParagraphTagAndStyle(style.getName(), (parentTableLevel > 0)); } else { tas = new TagAndStyle("p", null);