[Python] Word bullets and numbering using Python

Discussão em 'Python' iniciado por Stack, Junho 17, 2025.

  1. Stack

    Stack Membro Participativo

    I'm writing a code that transforms a Word document into a different format. Well, I've made the rest of the changes, but I'm having a problem with the numbering and bullets. I'd like to keep them. I've explored two ways, but neither achieves the goal:


    • Using pythondocx, I haven't been able to preserve the numbering or bullets associated with a list item; it simply recognizes that the text is in a list and that's it.


    • Using pywin32, I'm simulating what we would do manually as "Keep only unformatted text," and the problem is in the name itself. I need the text formats and the boxes they contain to be preserved.

    I need to keep everything as it is, just convert the numbers or bullets in the list format to text format.

    For Example:

    INPUT


    1. ASDASDADDADAD


    2. ADDDDDDdfsD

    OUTPUT

    1. ASDASDADDADAD

    2. ADDDDDDdfsD

    Continue reading...

Compartilhe esta Página