Page 1 of 1

Indicating Deleted Paragraph - Track Changes

PostPosted: Thu Aug 16, 2012 2:07 am
by MaxiSbr
Hello all,

I'm dealing with this track changes issue. MS Word has a way to indicate that a the paragraph mark delimiting the end of a paragraph within a WordprocessingML document shall be treated as deleted. The way to indicate that is adding a w:del tag to the run properties of the first run of the paragraph (inside the paragraph properties). In the XML:
I.e:
<w:body>
<w:p w:rsidR="00B60BAA" w:rsidDel="005215BF" w:rsidRDefault="00A95CB5">
<w:pPr>
<w:rPr>
<w:del w:id="0" w:author="Maxi" w:date="2012-08-14T16:35:00Z"/>
<w:lang w:val="en-US"/>
</w:rPr>
</w:pPr>
<w:proofErr w:type="spellStart"/>
<w:r>
<w:rPr>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>Hbksdbkhdsbkhvbdskhbvkhdsbkjnjkfd</w:t>
</w:r>
<w:proofErr w:type="spellEnd"/>
<w:r>
<w:rPr>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t xml:space="preserve"> n </w:t>
</w:r>

My issue is that I need a way to do this with docx4j.

Are the someone that deal with this?
I'll appreciate your help.

Thanks in advance,
Maxi

Re: Indicating Deleted Paragraph - Track Changes

PostPosted: Thu Aug 16, 2012 2:33 am
by MaxiSbr
Think I found it. I've to use ParaRPr.

:D

Re: Indicating Deleted Paragraph - Track Changes

PostPosted: Thu Aug 16, 2012 5:53 am
by MaxiSbr
Something like this:

CTTrackChange cttc = objectFactory.createCTTrackChange();
String user = (paragraph.getDiffUser() != null) ? paragraph.getDiffUser() : "No User Found";
cttc.setAuthor(user);
paraRPr.setDel(cttc);


Works!

I hope this be useful for someone.
Regards!