Ejemplo n.º 1
0
        private string OpenWordDoc(string wdDocName)
        {
            if (!File.Exists(wdDocName))
            {
                return(null);
            }
            object oMissing = System.Reflection.Missing.Value;
            string filename = wdDocName;

            try
            {
                this.Invoke(new EventHandler(btnExit_Click));
                axWbDoCView2.Navigate(filename, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
                return("success");
            }
            catch (Exception ex)
            {
                Globals.logAdapter.Record("EX925511256758", ex.Message + ">>" + ex.ToString(), true);

                ThisAddIn.killWordProcess();
                wordApp2 = null;
                axWbDoCView2.Navigate("about:blank");
                return(null);
            }
        }