Answers for "how to count docx pages python"

7

how to count docx pages python

from win32com.client import Dispatch
#open Word
word = Dispatch('Word.Application')
word.Visible = False
word = word.Documents.Open(os.path.abspath("Path_to_docx"))

#get number of sheets
word.Repaginate()
num_of_sheets = word.ComputeStatistics(2)
Posted by: Guest on April-19-2022

Python Answers by Framework

Browse Popular Code Answers by Language