示例#1
0
        public void ConcreteAdd()
        {
            ProcessControl processControl = new ConcreteProcessControl();

            processControl.KillWordProcess();
            string      currDir        = AppDomain.CurrentDomain.BaseDirectory;
            string      fileFullName   = string.Format(@"{0}Demo\标准模板(新).docx", currDir);
            string      outDirctoryUrl = string.Format(@"{0}NewFiles", currDir);
            FileControl fileControl    = new ConcreteFileControl();

            fileControl.CreateDirectory(outDirctoryUrl);
            string outFileFullName = string.Format(@"{0}NewFiles\{1}.docx", currDir, Guid.NewGuid().ToString());

            using (WordUtilExtensions wordUtil = new WordUtilExtensions(outFileFullName, fileFullName))
            {
                int result = wordUtil.AddCellLowerRightCornerContent("cyxz", "testcontent");
            }

            Console.WriteLine("success");
            Console.ReadLine();
        }
示例#2
0
        public void calculatePage()
        {
            ProcessControl processControl = new ConcreteProcessControl();

            processControl.KillWordProcess();
            string      currDir        = AppDomain.CurrentDomain.BaseDirectory;
            string      fileFullName   = string.Format(@"{0}Demo\StandardReport.docx", currDir);
            string      outDirctoryUrl = string.Format(@"{0}NewFiles", currDir);
            FileControl fileControl    = new ConcreteFileControl();

            fileControl.CreateDirectory(outDirctoryUrl);
            string outFileFullName = string.Format(@"{0}NewFiles\{1}.docx", currDir, Guid.NewGuid().ToString());

            using (WordUtilExtensions wordUtil = new WordUtilExtensions(outFileFullName, fileFullName))
            {
                wordUtil.TestPageHeight("test");
                wordUtil.TestPageHeight("test1");
                wordUtil.TestPageHeight("test3");
            }

            Console.WriteLine("success");
            Console.ReadLine();
        }