scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.35k stars 510 forks source link

Cannot read a slide's background colour if it was set at `slide layout` level #809

Open mszbot opened 2 years ago

mszbot commented 2 years ago

Problem: Cannot read a slide's background colour if it was set at slide layout level (not slide master level).

Code below returns a error: slide.slide_layout.background.fill.fore_color.rgb

Error: TypeError: fill type _NoFill has no foreground color, call .solid() or .patterned() first

To repro: Try to read the 2nd slide's background colour which is set at slide layout level: slidebackground tests.pptx

image

MartinPacker commented 2 years ago

Key question: How would you find this in the XML?