My goal is to write a macro that will insert a Frame at the end of paragraphs “As Character” and have the frame be of the appropriate width to match the margins of the paragraph. Putting the frame in is no problem, but I can’t for the life of me figure out how to determine that width. It’s obvious that it needs to be the [page width]-[left+right page margins]-[left margin of the paragraph] -[right margin of the paragraph]. The trouble is determining the left and right margins of the paragraph. (I believe that left margin will have contributions from the paragraph-level overrides, the paragraph style, and the numbering/bullet style and level.)
My version info:
Version: 7.5.7.1 (X86_64) / LibreOffice Community
Build ID: 47eb0cf7efbacdee9b19ae25d6752381ede23126
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
In order to not be too much trouble to the community, I’ve been using ChatGPT when I can; however, due to some incomplete documentation of the UNO API (and probably some clumsiness on my end), GPT keeps steering me in directions that return 0 for the left paragraph margin, even though that is obviously not correct.
