Hi guys, I want to add a custom footer to all of my word documents like "This document was written by PythonNewbie".

Let's say all of the reports are in a single directory.

Here's some code that I have which can do through and find files... Now I need a way to insert my footer into each document... Any ideas?

import os
from os.path import join, getsize
import glob

for root, dirs, files in os.walk('C:\\WordDocs'):
    for a_file in files:
        if a_file.find('.doc')>-1:
            filepath = os.path.join(root, a_file)
            #print a_file
            #print files
            #print filepath
            currentfile=open(filepath,'r')
            ####What do I do with the currentfile to add in my footer to every page of each document?

Thanks for the help!

Some search and...

Post if you get stuck later. :)

Cheers and Happy coding

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.