After ample research, the conclusion is, while PowerPoint does support a merge mode, there is no way to open it up in that mode with a command-line parameter.
But the API to merge documents is available in the COM object model and thus also from .NET through the Primary Interop Assemblies.
I ended up writing a small open-source project which acts as a proxy between the command-line and PowerPoint to launch and merge files. (currently still a work in progress and rough):
https://github.com/jessehouwing/ppt-diffmerge
ppt-diffmerge-tool --local="$LOCAL" --remote="$REMOTE" --base="$BASE" --output="$RESULT"
Core piece of code:
PowerPointApplication app = null;
Presentation presentation = null;
try
{
app = new PowerPointApplication();
app.PresentationCloseFinal += App_PresentationClose;
if (!string.IsNullOrWhiteSpace(Output))
{
File.Copy(Local, Output, true);
Local = Output;
}
presentation = app.Presentations.Open(Local);
if (string.IsNullOrWhiteSpace(Base))
{
presentation.Merge(Remote);
}
else
{
presentation.MergeWithBaseline(Remote, Base);
}
handle.WaitOne();
}
finally
{
Marshal.ReleaseComObject(presentation);
Marshal.ReleaseComObject(app);
}
return 0;
And it's crazy, even supports 3-way merges!
powerpoint.exe
via the command line and triggering the compare before even attempting to go any further. Like is it possible to run something likepowerpoint.exe --compare file1.ppt file2.ppt
? – Neoarsphenamine