winform在線操作office--dsoframerocx第三方控件
阿新 • • 發佈:2018-09-04
args clas reg eba pat initial 控件 show star
public Form1() { InitializeComponent(); RegControl();//註冊控件 axFramerControl1.Menubar = false;//file欄 axFramerControl1.Titlebar = false;//標題欄 // axFramerControl1.Toolbars = false;//工具欄 axFramerControl1.Dock = DockStyle.Fill; }private void 打開ToolStripMenuItem_Click(object sender, EventArgs e) { //this.axFramerControl1.Open(@"e:\2.doc");//註:_filePath為.doc或者.xls為後綴的文件; this.axFramerControl1.Open(@"e:\1.xls"); axFramerControl1.ModalState = true; //axFramerControl1.Activate();} private void 保存ToolStripMenuItem_Click(object sender, EventArgs e) { axFramerControl1.Save(); } public bool RegControl() { try { string sPath = @"C:\DsoFramer" + @"/dsoframer.ocx"; ProcessStartInfo psi= new ProcessStartInfo("regsvr32", "/s " + sPath); Process.Start(psi); } catch (Exception ex) { MessageBox.Show(ex.Message); } return true; }
winform在線操作office--dsoframerocx第三方控件