小 小毛孩 Unregistered / Unconfirmed GUEST, unregistred user! 2008-02-12 #1 怎样打开一个东东,比如说word文档,excel,txt等 谢谢!
L liyinwei Unregistered / Unconfirmed GUEST, unregistred user! 2008-02-12 #2 uses ShellAPI; ShellExecute(0, 'OPen', 'c:/123.txt', nil, nil, SW_NORMAL);
小 小毛孩 Unregistered / Unconfirmed GUEST, unregistred user! 2008-02-19 #3 方法可行,但如果txt或者doc等文件不存在,那我又怎样操作呢?
E erzhong008 Unregistered / Unconfirmed GUEST, unregistred user! 2008-02-19 #4 if fileexists(filename) then // else //
Z zjknight Unregistered / Unconfirmed GUEST, unregistred user! 2008-02-19 #5 楼上正解 先检查是否存在 然后再打开 或者用try结构
L liyinwei Unregistered / Unconfirmed GUEST, unregistred user! 2008-02-19 #6 const cFile = 'c:/123.txt'; begin if FileExists(cFile) then ShellExecute(0, 'Open', PChar(cFile), nil, nil, SW_NORMAL) else ShowMessage('文件“' + cFile + '“不存在!'); end;
const cFile = 'c:/123.txt'; begin if FileExists(cFile) then ShellExecute(0, 'Open', PChar(cFile), nil, nil, SW_NORMAL) else ShowMessage('文件“' + cFile + '“不存在!'); end;