You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I'm working on a python script which should be able to delete specific tables and paragraphs from a docx document. But I have a problem in that I cannot find out how to determine where in a document (relative to the paragraphs) a table is placed. Therefore I will have trouble finding and deleting the surrounding paragraphs after I have located a table that needs to be removed.
Is there any way to detect the flow of the document?
I have looked at the paragraph._p structure because issue #156 shows that this could be used to move a table in between specific paragraphs using the addnext() method. However, the getnext function of all my paragraphs seem to point to other paragraphs.
The text was updated successfully, but these errors were encountered:
@andcor: I think what you're looking for is this: #40
It's been a while since I've looked at it and these workarounds tend to be a bit brittle since they depend on internals that are subject to change.
But why don't you have a look and see what you can do. If it works, let me know; if it doesn't and you fix it, let me know too and I'll update the snippet. If you get stuck let me know and I'll see if I can help things along :)
Hi.
That were exactly what I wanted. Now I can begin rewriting my code to remove all the workarounds that I needed to implement to overcome the obsticle that I didn't know the structure of the document.
Thanks and thanks for all the great work you have done with this package.
Hi
I'm working on a python script which should be able to delete specific tables and paragraphs from a docx document. But I have a problem in that I cannot find out how to determine where in a document (relative to the paragraphs) a table is placed. Therefore I will have trouble finding and deleting the surrounding paragraphs after I have located a table that needs to be removed.
Is there any way to detect the flow of the document?
I have looked at the paragraph._p structure because issue #156 shows that this could be used to move a table in between specific paragraphs using the addnext() method. However, the getnext function of all my paragraphs seem to point to other paragraphs.
The text was updated successfully, but these errors were encountered: