python-docx Questions
4
In python-docx, the paragraph object has a method insert_paragraph_before that allows inserting text before itself:
p.insert_paragraph_before("This is a text")
There is no insert_paragraph_after...
Scarper asked 7/2, 2018 at 12:26
3
Solved
I'm using the python docx library and need to read data from tables in the document.
Although I'm able to read the data using the following code,
document = Document(path_to_your_docx)
tables = d...
Weiweibel asked 4/1, 2018 at 7:54
3
Solved
I am attempting to fill out a word document form with Python 2.7's docx module. I can modify text elements just fine but I am having difficulty figuring out how to check a yes or no checkbox.
How ...
Burrows asked 25/4, 2017 at 19:59
4
Solved
I am trying to create a program in python that can find a specific word in a .docx file and return page number that it occurred on. So far, in looking through the python-docx documentation I have b...
Cloakanddagger asked 24/3, 2016 at 4:11
4
Solved
When I am accessing paragraph text it does not include the numbering in a list.
Current code:
document = Document("C:/Foo.docx")
for p in document.paragraphs:
print(p.text)
List in docx...
Pifer asked 25/2, 2021 at 18:11
2
Solved
I want to write a program that copies text from a Word document and pastes it to another. I'm trying to do that using the python-docx library. I was able to do that with the following code, but it ...
Repetitious asked 19/2, 2018 at 15:36
2
I'm using python-docx library to extract data from a docx document, however I also want the heading number/ paragraph number. I want to build a build a proof reading tool for which I need to know t...
Dreiser asked 7/10, 2020 at 10:15
12
when I import docx I have this error:
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/docx-0.2.4-py3.3.egg/docx.py", line 30, in <module>
from ...
Vestment asked 31/3, 2014 at 15:11
3
Solved
I am using python docx library to manipulate a word document. However I can't find how to align a line to the center in the documents page of that library. I can't find by google either.
from doc...
Gravedigger asked 4/6, 2014 at 6:59
10
Solved
I need help replacing a string in a word document while keeping the formatting of the entire document.
I'm using python-docx, after reading the documentation, it works with entire paragraphs, so I...
Willman asked 14/1, 2016 at 0:39
3
Solved
Problem statement: Extract sections from .docx file including autonumbering.
I tried python-docx to extract text from .docx file but it excludes the autonumbering.
from docx import Document
do...
Exam asked 30/8, 2018 at 9:59
2
Solved
I want to insert fractions into WORD using python-docx, like below result in picture. I can only insert these: 15/20 + 4/20. I want to have the style look like the picture shows. Is it possible to ...
Grantgranta asked 1/2, 2022 at 19:53
6
Solved
I am using python-docx 0.7.6.
I can't seem to be able to figure out how to set font family and size for a certain paragraph.
There is .style property but style="Times New Roman" doesn't work.
Ca...
Exemplar asked 11/1, 2015 at 6:49
5
Solved
I'm trying to automate the creation of .docx files (WordML) with the help of python-docx (https://github.com/mikemaccana/python-docx). My current script creates the ToC manually with following loop...
Antares asked 3/9, 2013 at 15:17
5
Solved
I am trying to get this to work in python-docx:
A bullet list I can get using this:
from docx import Document
doc = Document()
p = doc.add_paragraph()
p.style = 'List Bullet'
r = p.add_run()
r...
Err asked 13/8, 2018 at 19:31
2
As far as I understand you can only change cell width of table.
Folliculin asked 27/6, 2018 at 10:26
5
Solved
I'm dealing with a problem trying to develop a web-app, part of which converts uploaded docx files to pdf files (after some processing). With python-docx and other methods, I do not require a windo...
Hoxsie asked 22/6, 2018 at 6:39
10
I am using python 2.7 with docx and I would like to change the background and text color of cells in my table based on condition.
I could not find any usefull resources about single cell formattin...
Distinctly asked 5/11, 2014 at 8:46
5
Solved
I want to extract text from word documents that were edited in "Track Changes" mode. I want to extract the inserted text and ignore the deleted text.
Running the below code I saw that paragraphs i...
Scanty asked 7/7, 2016 at 13:50
6
Solved
So I am starting to use pythons docx library. Now, I create a table with multiple rows, and only 2 columns, it looks like this:
Now, I would like the text in those cells to be centered horizonta...
Jahdal asked 11/3, 2017 at 14:25
1
If you see example here: https://www.geeksforgeeks.org/working-with-lists-python-docx-module/
Code is this:
# Import docx NOT python-docx
import docx
# Create an instance of a word document
doc = ...
Noctilucent asked 23/6, 2021 at 14:52
10
Can't open doxc file by path (Package not found at...)
View of directory:
Code:
from docx import Document
# some path of file:
path = 'TestDir/dir2/doc22.docx'
# open docx file:
doc = Document(...
Standee asked 9/11, 2017 at 10:21
1
Solved
I have a quite a few word files that have same table structure that I need to extract and save them into a csv/excel as a separate sheet (in .xls) for each word.docx.
Below only extracts first tabl...
Stylist asked 12/1, 2023 at 15:11
4
Solved
table = document.add_table(rows=1, cols=1)
hdr_cells = table.rows[0].cells
hdr_cells[0].text = 'Qty'
I have to change font size of text 'Qty' in table with one row and one column, how can I make ...
Edmondo asked 24/3, 2017 at 19:32
2
Solved
I'm working with the python-docx library from a forked version, and I'm having an issue with editing the elements list as it is defined as a property.
# docx.document.Document
@property
def element...
Raycher asked 16/12, 2022 at 16:36
1 Next >
© 2022 - 2025 — McMap. All rights reserved.