Windows – Creating an animation from a series of Word documents

command linemicrosoft wordvbawindows

I want to create a "time-lapse" movie of the multi-month editing process of a large Word document. I have created a script that runs every 15 minutes, saving a copy of the file if it has been edited, leaving me with a folder containing many copies of the document, named in chronological order, capturing the evolution of the document. (The document is written over the course of multiple months, so direct screen recording etc. is not an option).

To create the movie manually, I would open each file, check "View > Multiple Pages", adjust the zoom factor to show all pages of the current document, and make a screenshot. Rinse and repeat. (The movie should always show all pages of the document, it doesn't matter if the pages are reduced to "thumbnails")

How can I automate this process? I would see two strategies; the first one using Word and some scripting solution like VBA to somehow automate the above described manual process. Or to use a command line tool to render an overview of a word document as graphics, and use a simple batch script to render all documents. I cannot find a working solution using either of these two strategies. (I would slightly prefer the first option since I would like to have the user interface of Word visible in the movie)

Best Answer

It seems from the post that you have hundreds, if not thousands, of versions of one Word document, and you wish to create a video of its evolution.

Here is in general how I would have attacked such a problem:

  • Download and install the following free products :

  • Preset ShareX to capture the region of the screen in which Word will appear, with a hotkey for capturing this region, and set it to store screenshots in some empty folder

  • Make a list of the names of all the document files in ascending date order:

    dir /B /N D *.doc > script.ahk
    
  • Use a text editor of any kind that can massage this script into an AutoHotkey script so that each of the above document name becomes several lines as follows:

    • execute "document-name"
    • sleep the number of seconds needed for the document to load
    • send the ShareX hotkey to the desktop to cause a screenshot to be taken
    • sleep a bit
    • close Word, locating it via its title, by sending it Alt+F4
    • sleep a bit
  • Run the script

  • Stitch the set of images into a Timelapse video using VirtualDub

Alternatively to creating a script which may span thousands of lines, one can use the AutoHotKey commands of Loop, Files and sort (see manual).

The AutoHotkey script will probably take many minutes to execute, if not hours if you have thousands of documents. Test it first on a small subset of the documents.

If you don't know AutoHotkey, start with the tutorial found on its website and google for specific actions. There are many articles and sample scripts to be found, and also the members of the AutoHotkey forum are very helpful.

Related Question