Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/MsWordDiff/Word.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public static void Launch(string path1, string path2, bool quiet = false)
// WdAlertLevel.wdAlertsNone = 0
word.DisplayAlerts = 0;

// Disable AutoRecover to prevent "serious error" recovery dialogs
word.Options.SaveInterval = 0;

var doc1 = Open(word, path1);
var doc2 = Open(word, path2);

Expand Down Expand Up @@ -106,7 +109,13 @@ static void ApplyQuiet(bool quiet, dynamic word)

static dynamic Open(dynamic word, string path)
{
var doc = word.Documents.Open(path, ReadOnly: true, AddToRecentFiles: false);
var doc = word.Documents.Open(
path,
ConfirmConversions: false,
ReadOnly: true,
AddToRecentFiles: false,
OpenAndRepair: false,
NoEncodingDialog: true);
// Hide document window to prevent flickering while preparing comparison
doc.ActiveWindow.Visible = false;
return doc;
Expand Down