Tripat Bala Singh

Tripat Bala Singh

  • 1k
  • 627
  • 160k

How to save compare report of two word document in root.

Feb 1 2016 1:01 AM
How to save compare report of two word document in project root
 
 
try
{
object missing = System.Reflection.Missing.Value;
string apppath = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);//
apppath = apppath.Remove(apppath.Length - 10);
object fileToOpen = @"" + apppath + "\\DocFile\\RefDoc.doc";
string file = @"" + apppath + "\\DocFile\\TypedDoc.doc";
string roport = @"" + apppath + "\\DocFile\\Report.doc";
Microsoft.Office.Interop.Word.Application WA = new Microsoft.Office.Interop.Word.Application();
Document wordDoc = null;
wordDoc = WA.Documents.Open(ref fileToOpen, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
//object compareTarget = Microsoft.Office.Interop.Word.WdCompareTarget.wdCompareTargetNew;
wordDoc.Compare(file, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
//wordDoc.Close(ref missing, ref missing, ref missing);
//WA.Quit(ref missing, ref missing, ref missing);
MessageBox.Show("Compaire Sucessfull");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
 
 
i want to save two word document compare report in my root through C# programming 

Attachment: code.zip

Answers (1)