예제 #1
0
        void Application_WindowActivate(Microsoft.Office.Interop.Word.Document Doc, Microsoft.Office.Interop.Word.Window Wn)
        {
            try
            {
                // Template.GetInstance().DisplayBJLetter();
                Word.Document docCurr = this.Application.ActiveDocument;
                if (!String.IsNullOrWhiteSpace(docCurr.Path))
                {
                    //Template.GetInstance().DisplayBJLetter();
                    if (!TestDocu.ContainsKey(Doc))
                    {
                        TestDocu.Add(Doc, true);
                        Template.GetInstance().DisplayBJLetter();
                    }
                    // Otherwise, the doc is already in the set of open documents, hence we know the document is already open
                    else
                    {
                        if (TestDocu[Doc] == false)
                        {
                            //Console.WriteLine(doc.Name + " is already open!");
                            Template.GetInstance().DisplayBJLetter();
                        }
                    }
                }
                //if (initialized == false)
                //{
                //    Word.Document doc = this.Application.ActiveDocument;
                //    if (String.IsNullOrWhiteSpace(doc.Path))
                //    {

                //    }
                //    else
                //    {
                //        initialized = true;
                //        Template.GetInstance().DisplayBJLetter();
                //    }
                //}
            }
            catch (Exception ex)
            {
                Logger.LogWriter(ex.StackTrace);
            }
        }
예제 #2
0
 private void Application_WindowActivate(Microsoft.Office.Interop.Word.Document Doc, Microsoft.Office.Interop.Word.Window Wn)
 {
     try
     {
         CreateCiNiuTaskPane();
     }
     catch (Exception ex)
     { }
 }