I tried doing a copy from one document to a new document using the get and set for style, spacing etc but the paragraph in the new document didn't have the formating from the original document. How do I get and copy the details of the style?
-Andrew On Nov 21, 2011, at 8:27 AM, Nick Burch wrote: > On Tue, 15 Nov 2011, Tillinghast, Andrew P. wrote: >> The problem I'm having is there seems to be no way to create a copy of a >> paragraph. clone() is not visible > > Caling clone won't do it, because a paragraph's properties aren't generally > stored directly on it. Instead, they're held mostly in style tables, so to > copy a paragraph from one document to another you'll first have to identify > and clone the styling, before copying the text and linking it to the new > styles > > >> Is the only way to get a true copy of a paragraph to createParagraph() and >> manually set the styles, spacing etc to match the source and then >> createRun() for each run in the source and manually set the text styles etc >> to match the source? > > Largely, yes. Ideally we'd provide a helper method somewhere to do this for > people though (much as we have for HSSF/XSSF cell styles), if you do get this > working we'd love the patch! > > Cheers > Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
