Why can’t I use TFS Source Control to compare Office files?

This week I received an email from Yogita Manghnani, a Program Manager in the TFS Office Integration team who requested me to share my experiences with TFS. Since the beginning of TFS I'm one of those people who really adore TFS, but unfortunately not everything is implemented the way I like it. Two options I constantly struggle with are comparing Office files and the hierarchy of Work Items.

In this blog post I will discuss how I resolved my problem with comparing Office files. Still it isn't the best solution; my hope is on Microsoft to solve this problem completely. In one of my latest blogs I talked about using TFS for other IT related projects. We are using TFS to setup training material which consist of slide decks in PowerPoint, practicum description in Word and depending on the training examples and solutions in Visual Studio .NET. The best thing Source Control can do when you try to compare two Office files is displaying a message "Binary files differ". I know Microsoft is targeting on SharePoint for Office files and I'm a great admirer of SharePoint, but since I want to branch and compare the documents it isn't suitable for me and I hoped Source Control could do better.

So it's up to me to find a proper solution. I haven't check out what the possibilities are to extend Source Control so I first setup VS.NET to use another program to see the differences between Office files.

In Tools menu select Options

Within the tree follow this exact path

Source Control -> Visual Studio Team Foundation Server -> Configure User Tools ...

clip_image006

As you can see I wanted to let Word or PowerPoint decide what the differences are, but this is not possible. These two programs doesn't support the proper command-line switches. To check all command-line switches of the preferred Office tools, click these links:

Document-Comparison-Thumb2We're now in the stage of testing Diff Doc to this job. 'Diff Doc' is a powerful yet easy to use folder/file compare and remediation utility. You can use it to compare files of all types including MS Word/Excel/PowerPoint, PDF, RTF, Text, HTML, XML, WordPerfect and more.

When comparing to PowerPoint files it will result in the following screen dumps. 

clip_image002

clip_image004

And as you can see I'm now able to show if my branched Office files differs from the original. After this simple differ check I still want to use Word and PowerPoint to do the real compare and merge to both files. Within Word 2003 / 2007 it isn't a problem at all. Word supplies a great feature to see all differences, not only text, but also styles. Besides this it has a perfect interface to merge the two files.

clip_image008

PowerPoint 2007 on the other hand, has removed its feature to 'Compare and Merge Presentations', as you can see in the picture below. Who is responsible for such an act? I wonder how and when this is decided. Somebody had to say something like this. "You know what, since nobody complained about we forgot the 'Compare and Merge Presentations' feature in the 2007 beta phase, we'll just leave it out. And if we’re trying to release Office 2010 we'll mark it as a new feature again. This is a win/win situation. We got less to program now and add it as an additional feature in Office 2010." And all people of the Microsoft Office Team replied "You're the man".

clip_image010

So we're back to PowerPoint 2003 again which still contain this feature. To support 2007 File Formats in Office 2003 you'll need the Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats. See http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466. After installing this Pack which becomes almost a must for every old-fashioned Office user, we can compare PowerPoint Decks which we created in PowerPoint 2007.

clip_image014

Summary
What have you done Microsoft? How could you remove the astonishing compare function on PowerPoint files? You're absolutely not the man. Furthermore why doesn't Office give us the opportunity to compare two files using a command-line options. Please VSTS Team and Office Team talk to each other. Make your customers happier than they now are and please people respond if you've found another solution, I keep myself recommended.

 

2 thoughts on “Why can’t I use TFS Source Control to compare Office files?

  1. Oh, but you can.

    I remembered this trick from back when I was using subversion and TortoiseSVN for my finishing project at school. We had all our documentation in a Office 2003 file and a did a compare on the document. I was surprised to see that Word opened and showed us the diff.

    I started poking around and found a WScript that executed some code to open Office and show the diff.

    This is what you do:

    1. Go to TortoiseSvn homepage and download it
    2. Install TortoiseSvn
    3. Open Visual Studio -> Tools -> Options -> Source Control -> Visual Studio Team Foundation Server -> Configure User Tools. (phew a long way)
    4. Add a user tool like this:

    Extension: docx
    Operation: Compare
    Command: C:WindowsSystem32wscript.exe
    Arguments: "C:Program FilesTortoiseSVNDiff-Scriptsdiff-docx.js" %1 %2 //E:javascript

    (Have a look at the Diff-Scripts folder for powerpoint files, doc and others)

    5. Click OK
    6. Test it out by compare a docx file.

    There you go. Simple, and it works.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *