I have a powerpoint slide with a table. In the final column I have created a bulleted item which I'd like to copy to fit an arbitrary list of text.
How can I copy the first paragraph (with the bullet) to additional paragraphs. Copying the paragraph element doesn't work and lxml doesnt accept the bullet as a stand alone element.
Relevant code snippet below:
tf6 = tablegf.cell(1, 2).text_frame
comments = [loremipsum.get_sentences(5)]
bullet = '<a:rPr/>'
def addComments(comments, textframe):
comment = comments[0]
bulletp = textframe.paragraphs[0]
bulletp.text = comment
for comment in comments[1:]:
p = textframe.add_paragraph()
p._element = copy.deepcopy(bulletp._element)
p.text = comment
for paragraph in textframe.paragraphs:
paragraph.font.size = Pt(10)
return
addComments(comments, tf6)
The difference in the XML between a sample bulleted and unbulleted segment shown below. I can't figure out how to add the additional xml to the additional paragraphs
With Bullet
<a:p>
<a:pPr>
<a:defRPr sz="1000"/>
</a:pPr>
<a:r>
<a:rPr/>
<a:t>Massa metus magna urna a orci id nunc proin mattis semper natoque potenti nulla.</a:t>
</a:r>
</a:p>
Without Bullet
<a:p>
<a:pPr>
<a:defRPr sz="1000"/>
</a:pPr>
<a:r>
<a:t>Dolor donec sociis parturient purus erat dui nam.</a:t>
</a:r>
</a:p>