Link-HRSystems
asked on
Adobe reader can't open pdf file from shellexecute
I use a shellexecute command to open a pdf document from a delphi app. After upgrading Adobe Reader to 8.1.1 it no longer works and I get the error message:
There was an error opening this document. The file cannot be found.
The file can be opened from within Adobe Reader without any problems. It worked fine before 8.1.1.
Andy help would be appreciated. Thanks
There was an error opening this document. The file cannot be found.
The file can be opened from within Adobe Reader without any problems. It worked fine before 8.1.1.
Andy help would be appreciated. Thanks
ASKER
Here you go if it helps.
Thanks
Thanks
filename := ExtractFilePath(Application.ExeName)+ 'Documentation\'+ pdffile;
sExecutable := ShellFindExecutable(filename,ExtractFilePath(filename));
ShellExecute(hInstance, nil, PChar(sExecutable), pChar(filename), nil,
SW_SHOW);
Would you please try
if shellexecute(handle, nil, Pchar(filename), nil, nil, SW_SHOW) < 32 then
ShowMessage('Unable to open file');
As long as the .pdf extension is properly registered, (or any other extension) this should open Adobe and the file so there is no need of specifying the executable.
Therfor filename has to be the complete path filename and .pdf extension.
John
if shellexecute(handle, nil, Pchar(filename), nil, nil, SW_SHOW) < 32 then
ShowMessage('Unable to open file');
As long as the .pdf extension is properly registered, (or any other extension) this should open Adobe and the file so there is no need of specifying the executable.
Therfor filename has to be the complete path filename and .pdf extension.
John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the replies.
John
I can open the file using just the filename but I need to specify page number as well, that is why I was using Parameters.
Does anyone have the syntax to specify a page number as well?
Thanks
John
I can open the file using just the filename but I need to specify page number as well, that is why I was using Parameters.
Does anyone have the syntax to specify a page number as well?
Thanks
ASKER
This did answer my question wasn't my full issue, my mistake I will post another question.
Thanks
Thanks
ziolko.