Hi Stefan,
thanks for a quick response. I don't have regedit rights so is there any other way to associate printing of pdf files with certain application. I work on Windows XP SP2.
> Hi Niko,
>
> ShellExecute() returning Error 31 means "There is no application associated with the given file-name extension."
>
> > PDF files are associated with Acrobat Reader 5.0 in Explorer-->Tool-->Folder Options-->File Types.
> >
>
> You can see the associated commands for a given extension in Registry, where "open" and "print" might have different parameter strings content, and in your case perhaps "print" might not be associated at all in your particular setup?
>
>
>
> hth
> -Stefan
>
>
> > Hi fox(f)i(gh)ter's,
> > in the code bellow ShellExecute returns to value 31 wich means 'There is no application associated with the given filename extension.'
> >
> >
> > DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER lnHWnd,STRING lcAction,STRING lcFileName,STRING lcExeParams,STRING lcDefDir,INTEGER lnShowWindow
> >
> > lcPath="C:\PROGRAM FILES\ADOBE\ACROBAT 5.0\READER\ACRORD32.EXE"
> > afile="C:\PDFFile.PDF"
> > ShellExecute(0,"Print",lcPath,afile,"",1)
> >
> >
> > Does anyone know what the problem is about. When I put Open as command:
> >
> > ShellExecute(0,"Open",lcPath,afile,"",1)
> >
> > file is opening without problems. Also other types of files (like word,excel etc.) are printing with same command without problems. PDF files are associated with Acrobat Reader 5.0 in Explorer-->Tool-->Folder Options-->File Types.