|
Post by skrzat on Mar 14, 2005 7:04:50 GMT -5
How can I open PowerPoint ppt files using ShellExec function? Nothing happens when I try to open such a file.
|
|
|
Post by Murariu Alexandru on Mar 17, 2005 6:23:25 GMT -5
Your script looks like this?
var ERR : integer; ................ ShellExec('%SRCDIR%\myfile.ppt','','',SW_SHOWNORMAL,ERR);
This is one of the most common errors. The constant %SRCDIR% isn't replaced. That means that at runtime the shell tries to open %SRCDIR%\myfile.ppt and cannot find this path.
Solution: Use RepConst to replace the constant:
var ERR : integer; ................ ShellExec(RepConst('%SRCDIR%\myfile.ppt'),'','',SW_SHOWNORMAL,ERR);
If you replaced the constants and stil doesn't work(i do not think so) use Win32ErrorMsg function to get a description of the last error:
var ERR : integer; ................ ShellExec(RepConst('%SRCDIR%\myfile.ppt'),'','',SW_SHOWNORMAL,ERR); if ERR <> 0 then Win32ErrorMsg('ShellExecute');
|
|