public void Generate()
        {
            string DirPath = "";
            {
                HttpContext HttpCurrent = HttpContext.Current;
                if (HttpCurrent != null)
                    DirPath = HttpCurrent.Server.MapPath("~");
                else
                    DirPath = AppDomain.CurrentDomain.BaseDirectory;
                if (DirPath[DirPath.Length - 1] != '\\')
                    DirPath += @"\";
            }
            Application mApp = new Application();
            mApp.Visible = true;// false;
            Document mDoc = mApp.Documents.Add(DirPath + @"docs\中期汇报表.doc");            #region 填写表格
            mDoc.Tables[1].Cell(1, 2).Range.Text = "控制科学与工程学院";
            mDoc.Tables[1].Cell(1, 4).Range.Text = "测控技术与仪器";
            mDoc.Tables[1].Cell(2, 2).Range.Text = Student.name;
            mDoc.Tables[1].Cell(2, 4).Range.Text = Student.Teacher.Name;
            mDoc.Tables[1].Cell(3, 2).Range.Text = Issue.Title;
            if (Summary != null)
            {
                string s1 = "", s2 = "";
                {
                    string[] temp = new string[1];
                    temp[0] = "\r\n";
                    string[] stringList = Summary.Split(temp, StringSplitOptions.RemoveEmptyEntries);
                    int[] rowList = new int[stringList.Length];
                    int rowAll = 0, rowAllOne = 0, bestrow;
                    for (int i = 0; i < rowList.Length; i++)
                    {
                        rowLioust[i] = CreatWord.RowOfPara(stringList[i], 29);
                        rowAll += rowList[i];
                    }
                    rowAll = rowAll * 15 / (15 + 12);
                    for (bestrow = 0; bestrow < rowList.Length; bestrow++)
                        if (rowList[bestrow] < rowAll - rowAllOne)
                            rowAllOne += rowList[bestrow];
                        else
                            if (rowAllOne + rowList[bestrow] - rowAll <= rowAll - rowAllOne)
                                break;
                            else
                            {
                                bestrow--;
                                break;
                            }
                    for (int i = 0; i < rowList.Length; i++)
                        if (i <= bestrow)
                        {
                            if (s1.Length != 0)
                                s1 += temp[0];
                            s1 += stringList[i];
                        }
                        else
                        {
                            if (s2.Length != 0)
                                s2 += temp[0];
                            s2 += stringList[i];
                        }
                }
                mDoc.Tables[1].Cell(4, 2).Range.Text = s1;
                mDoc.Tables[2].Cell(1, 2).Range.Text = s2;
            }
            if (Comment != null)
                mDoc.Tables[2].Cell(2, 2).Range.Text = Comment;
            if (Sign)
            {
                Range place = mDoc.Tables[2].Cell(3, 2).Range.Characters.Last;
                place = mDoc.Range(place.End - 1, place.End - 1);
                CreatWord.SIGN(mDoc, place, Student.TeacherID);
            }
            if (FillDate != null)
                mDoc.Paragraphs.Last.Range.Characters.Last.Text = ((DateTime)FillDate).ToString("yyyy年MM月dd日");
            #endregion 填写表格            mDoc.SaveAs2(DirPath + @"docs\" + this.ID + ".doc");
            mDoc.Close();
            mApp.Quit();
            mDoc = null;
            mApp = null;
        }
这里面都什么意思能不能详细解释解释啊啊