Home » Developer & Programmer » Forms » Opening an unknown document type from forms (Forms Builder)
Opening an unknown document type from forms [message #403289] Thu, 14 May 2009 10:45 Go to next message
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 messageGo to next message
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 #404456 is a reply to message #403420] Thu, 21 May 2009 20:12 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Also research and trial using 'web.show_document'.

David
Re: Opening an unknown document type from forms [message #429533 is a reply to message #404456] Wed, 04 November 2009 07:15 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

Read some of my posts. you will get your answer there....
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
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

Previous Topic: Unable to views icon on button at run time
Next Topic: sending & reading data from excel,word
Goto Forum:
  


Current Time: Wed Sep 28 10:57:48 CDT 2016

Total time taken to generate the page: 0.09274 seconds