试用了一下又发现一个问题,我用18版本的tx做了一个文件,然后通过代码导入到我的程序,就报这个错误:cannot read from or write to a file ( 1 - 415),
我编写的代码如下:
string ls_path,ls_file
if GetFileOpenName ("Open", ls_path, ls_file, "Txw","Txw Files (*.txw),*.txw,Text Files (*.TXT),*.TXT,All Files (*.*), *.*") = 1 then
ole_text.object.headerfooterselect(0)
//打开文件
ole_text.object.text= ''
ole_text.object.LoadSaveAttribute(37,true)
ole_text.object.Load( ls_path, 0 ,3)---执行到这就报错了,报错提示如上
If ole_text.object.LoadSaveAttribute(0) > 0 Then ole_text.object.PageWidth = ole_text.object.LoadSaveAttribute(0)
If ole_text.object.LoadSaveAttribute(1) > 0 Then ole_text.object.PageHeight = ole_text.object.LoadSaveAttribute(1)
if ole_text.object.LoadSaveAttribute(2) > 0 Then ole_text.object.PageMarginL = ole_text.object.LoadSaveAttribute(2)
If ole_text.object.LoadSaveAttribute(3) > 0 Then ole_text.object.PageMarginT = ole_text.object.LoadSaveAttribute(3)
If ole_text.object.LoadSaveAttribute(4) > 0 Then ole_text.object.PageMarginR = ole_text.object.LoadSaveAttribute(4)
If ole_text.object.LoadSaveAttribute(5) > 0 Then ole_text.object.PageMarginB = ole_text.object.LoadSaveAttribute(5)
ole_text.object.ScrollPosY=0
changedirectory(gs_app_path)
else
changedirectory(gs_app_path)
end if
麻烦看一下是什么原因啊? |