Opening an unknown document type from forms [message #403289] |
Thu, 14 May 2009 10:45 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
garihood
Messages: 6 Registered: May 2009 Location: Wisconsin
|
Junior Member |
|
|
Hello,
I would like to know if there is a way to open up a document of unknown type (e.g. word/excel/PDF/txt/etc) from within Forms.
I know, for example, that you can open up a word document with something like this:
declare
AppID PLS_INTEGER;
begin
AppID := DDE.App_Begin('c:\office\WINWORD.EXE '||file name,DDE.APP_MODE_MINIMIZED);
end;
But I also know that the operating system knows by association what kind of application to use to open different file types. Is there any way to take advantage of this and issue from Forms some sort of "generic open file" request and allow the OS to use the correct application?
Thanks in advance.
|
|
|
Re: Opening an unknown document type from forms [message #403420 is a reply to message #403289] |
Fri, 15 May 2009 08:49 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
garihood
Messages: 6 Registered: May 2009 Location: Wisconsin
|
Junior Member |
|
|
Wow. Must be tough. Lots of reads but no replies.
Anyway, I found out how to do it, so no need to reply unless you know of a better way than this. I don't particularly like doing HOSTs, so maybe I'll try to integrate this method with the previously mentioned one (i.e. DDE.App_Begin).
Here's what I've found to work:
HOST('cmd.exe /c start '||filename);
Where filename is the document name that needs to be opened.
|
|
|
|
|
Re: Opening an unknown document type from forms [message #430467 is a reply to message #403289] |
Tue, 10 November 2009 08:53 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
brunobiondo
Messages: 6 Registered: November 2009 Location: Italy
|
Junior Member |
|
|
declare
AppID PLS_INTEGER;
begin
AppID := DDE.App_Begin('rundll32.exe url.dll, FileProtocolHandler "file_name.ext"', DDE.App_Mode_Normal);
--NOTE THAT YOU DO NOT SPECIFY THE APPLICATION TO LAUNCH,BUT THE FILENAME,WITH ANY EXTENSION,THEN WINDOWS FINDS THE ASSOCIATION FOR YOU
IF Form_Success THEN
message('command executed.');
ELSE
message('there was a problem executing command.');
ENDIF;
exception
.
.
end;
[Updated on: Tue, 10 November 2009 09:01] Report message to a moderator
|
|
|