• 大小: 69KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: C#
  • 标签: C#  winform  word  office  

资源简介

C# winform 使用第三方软件DsoFramer 创建 显示office 文档, office文档嵌入winform窗体内进行编辑。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        /*
         * winform中嵌入word、excel等  By  hnbc.info (www.hnbc.info)
         * winform中嵌入word的方法有多种,调用API,使用webBroser或使用DSOframeR控件
         * API过于繁琐,webbroser读取小文件还行,大文件就太痛苦了,所以还是选择DSOframeR实现
         * 使用微软的DSOframeR控件实现方法:
         * 先下载Dsoframer_KB311765_x86.exe ,自己百度一下有很多。
         * 安装,默认安装目录C:\Dsoframer
         * 可以先注册下:  开始菜单----运行   输入 regsvr32.exe C:\Dsoframer\dsoframer.ocx
         * 打开VS新建项目,设计模式下右键工具箱空白位置---选择项----选择COM组建----浏览选择刚刚的那个dsoframer.ocx,确定
         * 图文教程:http://www.hnbc.info/winfrom-embed-word-excel-implementation-source-code.html
         * 此时工具箱中多出一个DSO framer Control object 控件,把它拖到界面上
         * 在打开事件里添加 this.axframerControl1.Open(strFileName);  strFileName就是你要打开的文件了。
        */


        private void button1_Click(object sender EventArgs e)
        {
            OpenFileDialog op = new OpenFileDialog();
            op.ShowDialog();
           string strFileName = op.FileName;
            //If the user does not cancel open the document.
            if (strFileName.Length != 0)
            {
                this.axframerControl1.Open(strFileName);
            }

            //
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      17920  2013-06-06 12:54  WindowsFormsApplication4\bin\Debug\AxInterop.DSOframer.dll

     文件      20992  2013-10-08 18:48  WindowsFormsApplication4\bin\Debug\Interop.DSOframer.dll

     文件       9728  2013-10-08 18:48  WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.exe

     文件      28160  2013-10-08 18:48  WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.pdb

     文件      11600  2013-10-08 18:48  WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.vshost.exe

     文件        490  2012-06-02 22:34  WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.vshost.exe.manifest

     文件       1926  2013-10-08 18:48  WindowsFormsApplication4\Form1.cs

     文件       3105  2013-06-06 13:00  WindowsFormsApplication4\Form1.Designer.cs

     文件       6336  2013-06-06 13:00  WindowsFormsApplication4\Form1.resx

     文件      17920  2013-06-06 12:54  WindowsFormsApplication4\obj\x86\Debug\AxInterop.DSOframer.dll

     文件      13280  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6826  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        456  2013-06-06 13:00  WindowsFormsApplication4\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1078  2013-06-06 13:00  WindowsFormsApplication4\obj\x86\Debug\GenerateResource.write.1.tlog

     文件      20992  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\Interop.DSOframer.dll

     文件       3783  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.csproj.FileListAbsolute.txt

     文件        902  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.csproj.GenerateResource.Cache

     文件        741  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.csproj.ResolveComReference.cache

     文件       9728  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.exe

     文件        613  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.Form1.resources

     文件      28160  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.pdb

     文件        180  2013-10-08 18:48  WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.Properties.Resources.resources

     文件        505  2013-06-06 12:49  WindowsFormsApplication4\Program.cs

     文件       1384  2013-06-06 12:49  WindowsFormsApplication4\Properties\AssemblyInfo.cs

     文件       2898  2013-06-06 12:49  WindowsFormsApplication4\Properties\Resources.Designer.cs

     文件       5612  2013-06-06 12:49  WindowsFormsApplication4\Properties\Resources.resx

     文件       1109  2013-06-06 12:49  WindowsFormsApplication4\Properties\Settings.Designer.cs

     文件        249  2013-06-06 12:49  WindowsFormsApplication4\Properties\Settings.settings

     文件       4718  2013-06-06 12:56  WindowsFormsApplication4\WindowsFormsApplication4.csproj

     文件        411  2013-06-06 12:49  WindowsFormsApplication4\WindowsFormsApplication4.csproj.DotSettings.user

............此处省略14个文件信息

评论

共有 条评论