对于这个控件,使用的时候首先要在程序中注册,注册方法,如下 Delphi dsoframer OCX If System.IO.File.Exists("C:\WINDOWS\system32\dsoframer.ocx") Then 'C盘下已经存在dsoframer.ocxShellExecute(Nothing, "open", PFilePath + "\dsoframer.bat", Nothin
If System.IO.File.Exists("C:\WINDOWS\system32\dsoframer.ocx") Then 'C盘下已经存在dsoframer.ocx ShellExecute(Nothing, "open", PFilePath + "\dsoframer.bat", Nothing, Nothing, SW_HIDE) Else 'C盘下不存在dsoframer.ocx 则先检查debug下存不存在, '如果存在则复制到C盘目录下,如果不存在,则提示用户缺少必要文件! If System.IO.File.Exists(PFilePath + "\dsoframer.ocx") Then '复制ocx文件到"C:\WINDOWS\system32\"下 System.IO.File.Copy(PFilePath + "\dsoframer.ocx", "C:\WINDOWS\system32\dsoframer.ocx") ShellExecute(Nothing, "open", PFilePath + "\dsoframer.bat", Nothing, Nothing, SW_HIDE) Else MessageBox.Show("缺少dsoframer.ocx文件,请先保证debug下有这个文件") End If End If
' 在显示excel文件时,一直认为是因为在批量导入excel时释放了excel的com组件而导致的, ' 却没有将思路放在这个axframercontrol1.open的参数中,正确的使用是 AxFramerControl1.Open("F:\0.xls", False, "excel.sheet", "", "") AxFramerControl1.Open("F:\0.doc", False, "word.document", "", "")