Jason,
I'm trying to remove the sdt tag from a document section so the user can copy/paste from word into another document without copying the control block section. To avoid a control block in another control block.
Yes, if you carefully position the copy area you can only get the text or just remove the control block from word. But some users are not that savvy.
I have tried the following;
RemovalHandler rh = new RemovalHandler();
rh.removeSDTs(reportMLPackage, Quantifier.ALL);
reportMLPackage.save(new File(DIR_OUT + "_stripped.docx"));
System.out.println("Saved: " + DIR_OUT + "_stripped.docx");
and
Docx4J.save(wmlPackage, outFile, Docx4J.FLAG_BIND_REMOVE_SDT);
But cannot seen to remove the sdt tag.
I just want the sdt section removed and keep the P,Table.... objects within the sdt block.
I tried just extracting each object from the sdt and adding to a list<Object>
Then
WordprocessingMLPackage output = WordprocessingMLPackage.createPackage();
output.getMainDocumentPart().getContent().addAll(objects);
To create the file but images are not found.
Any ideas, help would be appreciated.
Thanks
Todd