I spent quite a lot of time trying to use an existing paragraph style on a RichText run (with no success obviously). I think the docs don't sufficiently emphasize the fact that this has to be a character style, not paragraph or linked.
I found the source of the problem by trying to create a run with my style using plain python-docx, got this nice error:
ValueError: assigned style is type PARAGRAPH (1), need type CHARACTER (2)
It would be a good idea to re-raise (or not silence) this exception, it will probably save a lot of frustration.
I spent quite a lot of time trying to use an existing paragraph style on a
RichText
run (with no success obviously). I think the docs don't sufficiently emphasize the fact that this has to be a character style, not paragraph or linked.I found the source of the problem by trying to create a run with my style using plain
python-docx
, got this nice error:It would be a good idea to re-raise (or not silence) this exception, it will probably save a lot of frustration.