Comparing Microsoft Powerpoint presentations stored in a Subversion repository
Update (2005/07/26): the latest version of TortoiseSVN comes with VBScripts for Word and OpenOffice documents comparison.
Following my previous post about the comparison of Word documents, here is the equivalent for Powerpoint presentations.
# Use the pywin32 extension and Microsoft Powerpoint to compare two presentations # Use this script with TortoiseSVN and extension-specific diff programs # with a command line like this : # c:\python24\pythonw.exe c:\path\to\powerpoint_diff.py %base %mine # $Id: powerpoint_diff.py 1355 2005-06-30 11:16:59Z nlehuen $ import win32com.client import sys import os try: # Get the absolute paths for the arguments # Powerpoint requires absolute paths. p1 = os.path.abspath(sys.argv[1]) p2 = os.path.abspath(sys.argv[2]) print "Comparing %s to %s..."%(p1,p2) # Open Powerpoint powerpoint = win32com.client.Dispatch("Powerpoint.Application") powerpoint.Visible = 1 # Open the first document destination = powerpoint.Presentations.Open(p1,ReadOnly=1) # Compare to the second document compare = destination.Merge(p2) # Mark the comparison document as saved to prevent the annoying # "Save as" dialog from appearing. powerpoint.ActivePresentation.Saved = 1 except: # In case of an exception, display it and wait for user input. import traceback traceback.print_exc() raw_input()