Ejemplo n.º 1
0
        public void ShowWithoutSignature(string fileName, LetterInvolvedPersonList otherSignList, bool isMainSignLetterPrepare, bool isRegisteredLP)
        {
            object     SaveChanges = (object)true;
            object     obj         = (object)false;
            XmlUtility xmlUtility  = new XmlUtility();
            string     str         = string.Concat(new object[4]
            {
                (object)string.Concat(new object[4]
                {
                    (object)(string)xmlUtility.EOrgDir,
                    (object)"\\",
                    (object)xmlUtility.GetCurrentProcess().Id,
                    (object)"\\"
                }),
                (object)"\\newFileName",
                (object)DateTime.Now.Ticks,
                (object)".doc"
            });

            try
            {
                this.InternalWordApp = new ApplicationClass();
                Document document = this.Open(this.InternalWordApp, fileName, false);
                this.ClearSign((Microsoft.Office.Interop.Word.Application) this.InternalWordApp, isMainSignLetterPrepare, otherSignList);
                this.SaveAsDoc(document, str);
                if (document != null)
                {
                    this.Close(document);
                }
                if (this.InternalWordApp.Documents.Count == 0)
                {
                    this.InternalWordApp.Quit(ref SaveChanges, ref obj, ref obj);
                }
                this.InternalWordApp = (ApplicationClass)null;
            }
            catch
            {
            }
            this.LoadDocument(str);
        }
Ejemplo n.º 2
0
 private void ClearSign(Microsoft.Office.Interop.Word.Application myApp, bool isMainSign, LetterInvolvedPersonList otherSignList)
 {
     try
     {
         List <Bookmark> list1 = new List <Bookmark>();
         foreach (Bookmark bookmark in myApp.ActiveDocument.Bookmarks)
         {
             list1.Add(bookmark);
         }
         for (int index = 0; index < list1.Count; ++index)
         {
             Bookmark bookmark = list1[index];
             string   str;
             try
             {
                 str = bookmark[];
             }
             catch
             {
                 continue;
             }
             if (str.StartsWith(((object)(Bookmarks)2).ToString()))
             {
                 bookmark.Select();
                 if (isMainSign)
                 {
                     myApp.Selection[] = "";
                 }
                 object Range = (object)myApp.Selection.Range;
                 myApp.ActiveDocument.Bookmarks.Add(((object)(Bookmarks)2).ToString(), ref Range);
             }
         }
         ((BusinessObjectList)otherSignList).SetSort((BusinessObjectList.SortOrderType) 0, new string[1]
         {
             "SignIndex"
         });
         List <Bookmark> list2 = new List <Bookmark>();
         foreach (Bookmark bookmark in list1)
         {
             try
             {
                 if (bookmark[].StartsWith(((object)(Bookmarks)8).ToString()))
                 {
                     list2.Add(bookmark);
                 }
             }