Hello Experts , in my code I wrote code to print a Document like below
Print()
{
IF NOT TryPrintDocument(Path,Name) THEN
ERROR('Not able to print %1. \\ERROR: %2',Path+Name, GETLASTERRORTEXT)
}
[TryFunction] TryPrintDocument(PathP : Text;NameP : Text)
{
ProcessStartInfo := ProcessStartInfo.ProcessStartInfo(PathP+NameP);
WITH ProcessStartInfo DO BEGIN
Verb := 'Print';
CreateNoWindow := TRUE;
WindowStyle := ProcessWindowStyle.Hidden;
END;
Process.Start(ProcessStartInfo);
CLEAR(ProcessStartInfo);
CLEAR(Process);
CLEAR(ProcessStartInfo);
}
But While running this code I am getting error
Error :
Not able to print C:\Temp\test.pdf.
ERROR: A call to System.Diagnostics.Process.Start failed with this message: No application is associated with the specified file for this operation