我的毕业设计:论文格式修正系统,名字是自己取的,方便大家理解。

具体干啥呢?

所谓的市场价值,也就是我认为的意义:主要是现在大学论文,毕业论文,硕士论文,博士论文格式都很固定,但是广大的大学生,硕士生等就像小学生一样会犯这种格式的错误,而大学老师,博士,讲师又懒得去改这些,我的课题就出来了,论文格式修正...

这个东西的市场价值我觉得可能在学校会大一些,如果做成一个系列的产品进入高校估计还是有点市场的。

下面我还是主要讲一下具体开发需要去了解和技术要求,这个东西开发主要还是要建立在微软的office基础上,因为题目的另一个名字,word的自动检测,前面的东西我就略过了,直接讲实在的东西:

用Visual Studio写,语言C#,B/S模式,需要引入微软的COM组件,下面我先介绍一下这个东西

关于Microsoft.Office.Interop.Word类库

http://hi.baidu.com/imouse728/blog/item/c406208022f9c1d19023d925.html这个里面已经说得很清楚了

关于头部的引用就是using word;

这样我们就可以用根据这个东西参考帮助文档里面的类库说明,写一些关于word的操作说明了。

比如word的创建,word的读取,word里面段落的读取...

这些都是很简单的,网上也有很多的说明....

http://www.360doc.com/content/090510/10/64176_3440638.html

http://gzkeith.blog.163.com/blog/static/499164120069318531759/

http://www.cnblogs.com/Andmm/archive/2008/06/18/1224422.html

程序最重要的是算法,这里我的程序最关键的也就在这里了:

系统最关键部分:两篇Word文档比较(一篇是学生的论文,一篇是范文),得到一个报告。

这个比较怎么做呢?要考虑很多问题...我随便写几个

1.论文的格式好多,你怎么选择固定的格式

2.你比较得到的报告肯定是越详细越好,但是你比较的东西也会越多,摘要,关键词格式,字体大小等等

3.学生论文是很多的,肯定要考虑到批量修改,那么算法是越优化越好

。。。。

下面是我收集的一些材料和我写的一些程序,算是一个实例化的可行性分析,里面包含了一个完整的word操作代码

如果你只是需要学习点东西,那你可以直接拿去,如果你对此感兴趣或者是这方面的高手,希望能跟你交流,得到你的帮助

加QQ留言都可以。

1.我收集的资料下载

2.我写的测试程序下载

代码

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Reflection;
using Word;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        object filename = "F:\\wordtest\\myword.doc";
        object oMissing = System.Reflection.Missing.Value;
        object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */

//Start Word and create a new document.
        Word._Application oWord;
        Word._Document oDoc;
        oWord = new Word.Application();
        oWord.Visible = true;
        oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
         ref oMissing, ref oMissing);

//Insert a paragraph at the beginning of the document.
        Word.Paragraph oPara1;
        oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
        oPara1.Range.Text = "Heading 1";
        oPara1.Range.Font.Bold = 1;
        oPara1.Format.SpaceAfter = 24;    //24 pt spacing after paragraph.
        oPara1.Range.InsertParagraphAfter();

//Insert a paragraph at the end of the document.
        Word.Paragraph oPara2;
        object oRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        oPara2 = oDoc.Content.Paragraphs.Add(ref oRng);
        oPara2.Range.Text = "Heading 2";
        oPara2.Format.SpaceAfter = 6;
        oPara2.Range.InsertParagraphAfter();

//Insert another paragraph.
        Word.Paragraph oPara3;
        oRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        oPara3 = oDoc.Content.Paragraphs.Add(ref oRng);
        oPara3.Range.Text = "This is a sentence of normal text. Now here is a table:";
        oPara3.Range.Font.Bold = 0;
        oPara3.Format.SpaceAfter = 24;
        oPara3.Range.InsertParagraphAfter();

//Insert a 3 x 5 table, fill it with data, and make the first row
        //bold and italic.
        Word.Table oTable;
        Word.Range wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        oTable = oDoc.Tables.Add(wrdRng, 3, 5, ref oMissing, ref oMissing);
        oTable.Range.ParagraphFormat.SpaceAfter = 6;
        int r, c;
        string strText;
        for (r = 1; r <= 3; r++)
            for (c = 1; c <= 5; c++)
            {
                strText = "r" + r + "c" + c;
                oTable.Cell(r, c).Range.Text = strText;
            }
        oTable.Rows[1].Range.Font.Bold = 1;
        oTable.Rows[1].Range.Font.Italic = 1;

//Add some text after the table.
        Word.Paragraph oPara4;
        oRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        oPara4 = oDoc.Content.Paragraphs.Add(ref oRng);
        oPara4.Range.InsertParagraphBefore();
        oPara4.Range.Text = "And here's another table:";
        oPara4.Format.SpaceAfter = 24;
        oPara4.Range.InsertParagraphAfter();

//Insert a 5 x 2 table, fill it with data, and change the column widths.
        wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        oTable = oDoc.Tables.Add(wrdRng, 5, 2, ref oMissing, ref oMissing);
        oTable.Range.ParagraphFormat.SpaceAfter = 6;
        for (r = 1; r <= 5; r++)
            for (c = 1; c <= 2; c++)
            {
                strText = "r" + r + "c" + c;
                oTable.Cell(r, c).Range.Text = strText;
            }
        oTable.Columns[1].Width = oWord.InchesToPoints(2); //Change width of columns 1 & 2
        oTable.Columns[2].Width = oWord.InchesToPoints(3);

//Keep inserting text. When you get to 7 inches from top of the
        //document, insert a hard page break.
        object oPos;
        double dPos = oWord.InchesToPoints(7);
        oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range.InsertParagraphAfter();
        do
        {
            wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
            wrdRng.ParagraphFormat.SpaceAfter = 6;
            wrdRng.InsertAfter("A line of text");
            wrdRng.InsertParagraphAfter();
            oPos = wrdRng.get_Information
                                 (Word.WdInformation.wdVerticalPositionRelativeToPage);
        }
        while (dPos >= Convert.ToDouble(oPos));
        object oCollapseEnd = Word.WdCollapseDirection.wdCollapseEnd;
        object oPageBreak = Word.WdBreakType.wdPageBreak;
        wrdRng.Collapse(ref oCollapseEnd);
        wrdRng.InsertBreak(ref oPageBreak);
        wrdRng.Collapse(ref oCollapseEnd);
        wrdRng.InsertAfter("We're now on page 2. Here's my chart:");
        wrdRng.InsertParagraphAfter();

//Insert a chart.
        Word.InlineShape oShape;
        object oClassType = "MSGraph.Chart.8";
        wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        oShape = wrdRng.InlineShapes.AddOLEObject(ref oClassType, ref oMissing,
         ref oMissing, ref oMissing, ref oMissing,
         ref oMissing, ref oMissing, ref oMissing);

//Demonstrate use of late bound oChart and oChartApp objects to
        //manipulate the chart object with MSGraph.
        object oChart;
        object oChartApp;
        oChart = oShape.OLEFormat.Object;
        oChartApp = oChart.GetType().InvokeMember("Application",
         BindingFlags.GetProperty, null, oChart, null);

//Change the chart type to Line.
        object[] Parameters = new Object[1];
        Parameters[0] = 4; //xlLine = 4
        oChart.GetType().InvokeMember("ChartType", BindingFlags.SetProperty,
         null, oChart, Parameters);

//Update the chart image and quit MSGraph.
        oChartApp.GetType().InvokeMember("Update",
         BindingFlags.InvokeMethod, null, oChartApp, null);
        oChartApp.GetType().InvokeMember("Quit",
         BindingFlags.InvokeMethod, null, oChartApp, null);
        //... If desired, you can proceed from here using the Microsoft Graph 
        //Object model on the oChart and oChartApp objects to make additional
        //changes to the chart.

//Set the width of the chart.
        oShape.Width = oWord.InchesToPoints(6.25f);
        oShape.Height = oWord.InchesToPoints(3.57f);

//Add text after the chart.
        wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        wrdRng.InsertParagraphAfter();
        wrdRng.InsertAfter("THE END.");

oDoc.SaveAs(ref filename, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
        oDoc.Close(ref oMissing, ref oMissing, ref oMissing);
        oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
        Response.Write("<script language='javascript'>alert('文档创建成功!');</script>");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        object filename = "F:\\wordtest\\test.doc";
        object oMissing = System.Reflection.Missing.Value;
        Word._Application oWord;
        Word._Document oDoc;
        oWord = new Word.Application();
        oWord.Visible = true;
        oDoc = oWord.Documents.Open(ref filename, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,ref oMissing);
        oDoc.ActiveWindow.Selection.WholeStory();
        oDoc.ActiveWindow.Selection.Copy();
        this.TextBox1.Text = oDoc.Paragraphs.Count.ToString();
        this.TextBox2.Text = oDoc.Paragraphs[1].Range.Text;
        this.TextBox3.Text = oDoc.Paragraphs[2].Range.Text;
        this.TextBox4.Text = oDoc.Paragraphs[3].Range.Text;
        oDoc.Close(ref oMissing, ref oMissing, ref oMissing);
        oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
        Response.Write("<script language='javascript'>alert('数据读取成功!');</script>");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        object filename1 = "F:\\wordtest\\test1.doc";
        object filename2 = "F:\\wordtest\\test2.doc";
        object oMissing = System.Reflection.Missing.Value;
        Word._Application word1,word2;
        Word._Document doc1,doc2;
        word1 = new Word.Application();
        word2 = new Word.Application();
        word1.Visible = true;
        word2.Visible = true;
        doc1 = word1.Documents.Open(ref filename1, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
        doc2 = word2.Documents.Open(ref filename2, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
        object keyword = doc2.Paragraphs[2].Range.Words.ToString();
        this.TextBox5.Text = keyword.ToString();
        word1.Application.Selection.ClearFormatting();
        if (word1.Application.Selection.Find.Execute(ref keyword,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing))
        {
            Response.Write("<script language='javascript'>alert('找到关键字!');</script>");
            this.TextBox5.Text = "";
        }
        else
        {
            Response.Write("<script language='javascript'>alert('未发现关键字!');</script>");
        }

//string titlefont1 = doc1.Paragraphs[1].Range.Font.Name.ToString();
        //string titlefont2 = doc2.Paragraphs[1].Range.Font.Name.ToString();
        //string titlesize1 = doc1.Paragraphs[1].Range.Font.Size.ToString();
        //string titlesize2 = doc2.Paragraphs[1].Range.Font.Size.ToString();
        /*if (titlefont1 == titlefont2 && titlesize1 == titlesize2)
        {
            Response.Write("<script language='javascript'>alert('标题字体类型和大小都相同!');</script>");
        }
        else if (titlefont1 != titlefont2 && titlesize1 == titlesize2)
        {
            Response.Write("<script language='javascript'>alert('标题字体类型不同,大小相同!');</script>");
        }
        else if (titlefont1 == titlefont2 && titlesize1 != titlesize2)
        {
            Response.Write("<script language='javascript'>alert('标题字体类型相同,大小不同!');</script>");
        }
        else
        {
             Response.Write("<script language='javascript'>alert('标题字体类型和大小都不相同!');</script>");
        }*/
        doc1.Close(ref oMissing, ref oMissing, ref oMissing);
        word1.Quit(ref oMissing, ref oMissing, ref oMissing);
        doc2.Close(ref oMissing, ref oMissing, ref oMissing);
        word2.Quit(ref oMissing, ref oMissing, ref oMissing);
        
    }

}

这张图片只是我用来写测试程序的,方便大家理解!

转载于:https://www.cnblogs.com/zhulidong/archive/2009/12/03/1616173.html

【欢迎大家一起交流讨论】关于Word的自动检测修改--论文格式修正系统(毕业设计)...相关推荐

  1. 计算机网络相关论文目录怎么弄,Word如何自动生成目录 论文排版必备小技巧

    在word中如何自动生成目录?这个问题,相信困扰着不少为了论文而付出不少汗水的娃儿.看着一篇长长的论文,还需要一个标题一个标题的去复制黏贴,做成目录列表,那比写论文还要让人苦逼啊,对吧?尤其对于大学毕 ...

  2. Mac Word 公式自动编号与交叉引用

    前言 Word 在公式交叉引用时,会出现引用整个公式的情况,个人认为是产品缺陷. 微软官方声称可通过「样式分隔符」解决该问题,但 Mac 下的 Word 并不支持该命令,因此在多方查阅下,本文推荐用修 ...

  3. 微软输入法的m图标怎么设置_如何在Microsoft Word中获取“ L”形的格式设置图标?...

    微软输入法的m图标怎么设置 Each of us has a preferred layout and setup when we are working with Microsoft Word, b ...

  4. word 标题自动编号、按章节给图片设置题注、给图片添加对应的文字交叉引用

    论文标题自动编号.按章节给图片设置题注.给图片添加对应的文字交叉引用 1.准备环节及工作环境 2.多级列表 2.1 定义新的多级列表 2.2 修改标题格式 3.按章节给图片编号 3.1 插入题注 3. ...

  5. php如何word转html格式文件,PHP将上传word文件,转化为Html格式,(多种转换方式)

    标签:主机   git   not   __name__   sts   offic   write   otto   ice 方法一: 通过PHPOffice(推荐) 1: composer req ...

  6. Word 2007 自动更新,让操作速度加倍!

    现在很多软件只要是一打开运行,首先便是自动检测.更新,升级程序,以使程序保持最新状态.其实在Word某些地方也有自动更新功能,只是我们没有加以利用罢了,如果能将这些自动更新功能充分利用的话,那带给我们 ...

  7. word标题自动编号

    word标题自动编号 wps可以只设置编号,,设置一次后,后面能自动跟着设置编号.只有编号不设置标题,不能生成导航和目录. word版调整方式: 1.需要编号的文字样式设置对应的标题样式,可以设置一个 ...

  8. 根据Word表格自动生成SQL数据库脚本的VBScript代码

    这是几年前写的根据Word表格自动生成SQL数据库脚本的VBScript代码,最近修改了下(原来只支持单个Word表格)使其支持一个Word文档中的多个表格,生成的SQL文件名以Word文件名+.SQ ...

  9. webstorm如何自动换行_怎样在word中自动生成目录

           欢迎关注支持,谢谢!!! 用 Word 编排好一本书后,不用制作目录,可以用自动生成的方法生成,那么Word2016目录怎么自动生成呢?如果要自动生成目录,排版时就要设置好章节,如果等排 ...

最新文章

  1. Python 中的魔术方法(双下划线开头和结尾的方法)
  2. opencv中stereoCalibrate函数双目标定
  3. (七)Amazon Lightsail 部署LAMP应用程序之清除已安装服务
  4. 英媒:滴滴和优步每年烧钱64亿
  5. typescript 方法后面加感叹号_TypeScript编译器SDK版本问题
  6. Navicat for MySQL 连接 Mysql 8.0.11 出现1251- Client does not support authentication protocol
  7. 回到地球之后,这个男人创建了Ubuntu
  8. 基于角色的访问控制'的权限管理的数据库的设计实现
  9. CPU怎么认识代码的?
  10. 嵌入式linux文件系统类型,嵌入式Linux 的Cramfs 根文件系统配置的解决方案
  11. CSAPP:第八章 异常控制流1
  12. android设置密码框,Android手机卫士之设置密码对话框
  13. python pip下载安装一半退出_【Python】pip安装numpy安装到一半失败解决办法
  14. 学会如何使用移动用户反馈系统,让你玩转APP
  15. IntelliJ IDEA 设置快捷键(Keymap)
  16. 计算机与文秘专业有哪些课程,文秘专业开设的课程有哪些
  17. DOSLinux命令大全
  18. 给android手机划代
  19. 提升视频监控效能 纵横网络有效防控
  20. 基于 FPGA Vivado 信号发生器设计(附源工程)

热门文章

  1. 创业赚钱 卖货 做项目如何最大化保证成功?
  2. 记住影响客户购买的3个决策关键
  3. 现在很多人都在网上找富业
  4. 零售的本质是什么呢?
  5. 如何在工作中学习,让自己成为领域专家?
  6. 农村电商的发展非常关键,那么农民要如何利用电商呢?
  7. React:开发者友好性和易用性
  8. According to the overall view of the patent
  9. Solidity 中 revert(), assert() 和 require() 的使用方法
  10. 计算机存储T,GB,MB,KB,B,bit