test2.aspx.cs

来自「在线 图书网上购物系统」· CS 代码 · 共 41 行

CS
41
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Word;

public partial class test2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        object ofile = null;
            object oMissing = System.Reflection.Missing.Value;
             ofile = @"d:\1.doc";
                Word.ApplicationClass mWord =new Word.ApplicationClass();
                mWord.Visible = true;
                Word.Document mDoc;

                string path = @"d:\MyTest.txt";
            
  
                mDoc = mWord.Documents.Open(ref ofile, 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);
                int nparagraphs = mDoc.Paragraphs.Count;

       
        
        
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?