I am working in python to create a script that spits out a powerpoint report. I want to add some tables but the tables that are getting generated are too big with too much wasted space. I’ve figured out how to manually set the table margins in powerpoint itself but I want a way to have it changed automatically. If you select the table in powerpoint and go to format shape -> text options -> text box then set all the margins to 0. I want to have my script do that atuomatically. I haven’t figured out how to do this. Anyone figure this issue out?
I”ve tried this
cell = table_shape.cell(r,c)
text_frame = cell.text_frame
text_frame.margin_left = Pt(0)
text_frame.margin_right = Pt(0)
text_frame.margin_top = Pt(0)
text_frame.margin_bottom = Pt(0)
and nothing in the table changed
cderosia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.