Re: ShellExecute fails when printing a document.

From: Gon Nadiya (WazHot_at_mymail.com)
Date: 11/02/04


Date: Tue, 2 Nov 2004 09:37:25 +0600


Rolf,

Thanks for the information.
As I learnt to overcome this in my registry I need to add a new shell for
'Print'.
For this I want to find the command which is to be given.
Does anyone know what should be the command I should give to print an eml
file?

I can't prompt the user to print the document as this is happeneng in an
automated system where there's no user intervention.
Hence it is impossible to ask the user to print.

Will the code you got help me to find the command to print?
If so please send me it.
Thanks.

Nadee.

"Rolf Lystad" <rolf@invalid.invalid> wrote in message
news:uyO94BGwEHA.2624@TK2MSFTNGP11.phx.gbl...
> >
> > ShellExecute(lnHandle,"PRINT",lcFile,"","",1)
> >
> > The error message is "31,There is no association for the specified file
> > type
> > or there is no association for the specified action within the file
type"
> > But when seected to open it opens in Microsoft Outlook without a
problem.
> >
> > When I right click on an eml file in the menu the print option is not
> > shown.
> > Is this is cause for this error?
>
> Yes, it is
>
> > Is there a way I can overcome this issue?
>
> I suggest you check the registry before using ShellExecute.
> Both to see if there is a value for ...\shell\open\ddeexec or
> ...\shell\open\command and to check if there is a value for
> ...\shell\print\ddeexec or ..\shell\print\command.
> If the file cannot be printed with ShellExecute, you can inform the user
> that the file will be opened instead of printed, and that the user has to
do
> the printing himself.
>
> If you need further assistance, I can post code for handling this.
>
>
>



Relevant Pages

  • Re: Paramstr
    ... > Might I suggest you use CreateProcess instead? ... > registry doesn't match what you tell it to use. ... Does ShellExecute return an error code? ... the length of the command line may be a factor. ...
    (alt.comp.lang.borland-delphi)
  • Re: Paramstr
    ... > I am uding shellexecute in a program to start an other program with 3 ... registry doesn't match what you tell it to use. ... Windows NT, the length of the command line may be a factor. ...
    (alt.comp.lang.borland-delphi)
  • Re: New IE Instance
    ... Instead of using ShellExecute on the HTML ... > file itself it looks in the registry for the associated executable and ... > launches that instead with the URL as a command line parameter. ...
    (borland.public.delphi.nativeapi)
  • Re: cleanup after malware/trojan/virus
    ... See if Start, Run, COMMAND works - it probably will. ... When you get into the registry, ... Highlight the Drivers32 folder on the left and observe the contents ... Specifically open the exported file with a text editor. ...
    (microsoft.public.windowsxp.help_and_support)
  • reply
    ... >tried deleting it from the msconfig Startup tool system, ... neither the listed name or command line name ... First, ME comes with a registry backup application, try ... folder temporarily by using attrib.exe: ...
    (microsoft.public.security.virus)