0

I am using Python 2.7 with python pptx and need to add border to some text i am writing.

I need it to be a simple box in a color that i specify around the text

I found here the text related object but I don't find any mention to what I need, and I found here a similar question about tables but with no answer...

Thanks

Community
  • 1
  • 1
thebeancounter
  • 4,261
  • 8
  • 61
  • 109

1 Answers1

1

I'm not sure what objects in Word can have a border. I expect a paragraph can, but not sure a run of text can. You can determine this pretty quickly by experimenting with the Word UI.

In any case, that feature is not implemented in python-docx yet.

scanny
  • 26,423
  • 5
  • 54
  • 80
  • so i can't use python-pptx to add a border to a paragraph yet? – thebeancounter Apr 25 '17 at 08:33
  • No. At least not using the API. You can use the `Paragraph` object to get the `` element (`p = paragraph._p`) and manipulate the XML for the paragraph directly using lxml calls. This is what folks generally do to write workaround extensions. – scanny Apr 25 '17 at 14:31