Re: ShellExecute fails when printing a document.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Rolf Lystad (rolf_at_invalid.invalid)
Date: 11/01/04


Date: Mon, 1 Nov 2004 23:16:42 +0100


>
> 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: error messages practically worthless
    ... the .open statement) it opens fine. ... Access itself makes the query statement. ... Dim cnnFLDCW, cnnCurPrj As ADODB.Connection ... > ways to get this error message, such as typographical errors, incorrect ...
    (microsoft.public.access.externaldata)
  • Re: shortcuts wont open
    ... And do you encounter the same error message if you open the document, ... not the shortcut to the document, ... >>> Any desktop shortcut or recent documents that opens ...
    (microsoft.public.office.misc)
  • Re: Error accessing the system registry
    ... revolve around the macros... ... > privileges to everything in the Office suite. ... > Administrator, the file opens fine. ... > search Microsoft support for some reference to this error message. ...
    (microsoft.public.mac.office.excel)
  • Re: Unexplained code is running!
    ... Tom Ellison ... attempt to open the main form, I get the same error message. ... Still the error message occurs when the form opens. ... and created my own Open event, ...
    (microsoft.public.access.formscoding)
  • Re: Unexplained code is running!
    ... Tom, I think you should have gone to bed. ... attempt to open the main form, I get the same error message. ... Still the error message occurs when the form opens. ... and created my own Open event, ...
    (microsoft.public.access.formscoding)