HOW DO I - open a file with the associated program

I want to open a file in reponse to a button click.  The file might be a
Word document or a PDF file, etc.  I want the appropriate application to
open the file based on the file type.  Is there an easy way to do this in
PB?  If so, I can't find it.  Thanks for any help!


0
Jim
8/6/2002 8:51:56 PM
sybase.powerbuilder.general 62418 articles. 12 followers. Follow

3 Replies
294 Views

Similar Articles

[PageSpeed] 35

YEs, it's easy. You have to use ShellExecute external API function with
"Open" keyword. It will open for you any file that it's extension is
registered in the system.

"Jim Steil" <jim.steil@customcall.com> wrote in message
news:zUNpFyYPCHA.77@forums.sybase.com...
> I want to open a file in reponse to a button click.  The file might be a
> Word document or a PDF file, etc.  I want the appropriate application to
> open the file based on the file type.  Is there an easy way to do this in
> PB?  If so, I can't find it.  Thanks for any help!
>
>


0
Michael
8/6/2002 8:57:25 PM
Thank you!!  Thank You!!  Thank You!!


"Michael Chernin" <michaelc@city.kitchener.on.ca> wrote in message
news:lSGba2YPCHA.197@forums.sybase.com...
> YEs, it's easy. You have to use ShellExecute external API function with
> "Open" keyword. It will open for you any file that it's extension is
> registered in the system.
>
> "Jim Steil" <jim.steil@customcall.com> wrote in message
> news:zUNpFyYPCHA.77@forums.sybase.com...
> > I want to open a file in reponse to a button click.  The file might be a
> > Word document or a PDF file, etc.  I want the appropriate application to
> > open the file based on the file type.  Is there an easy way to do this
in
> > PB?  If so, I can't find it.  Thanks for any help!
> >
> >
>
>


0
Jim
8/6/2002 9:13:54 PM
If all you want to do is launch something, the PB script RUN( )
command works OK, too, and there's no external function call
required.
0
woz
8/7/2002 4:15:57 PM
Reply:

Similar Artilces:

Associated program by file type
Is there any functions in PB or Win API which allows you to pass it a file type and it returns some sort of description of the application associated with that file type? For example:- pass to the function '.DOC' and it returns something like 'Word 7.0 Document' Thanks in advance... -- David Hepburn, Sydney, Australia. RegistryGet("HKEY_CLASSES_ROOT\.doc", "", ls_value) will return something like "Word.Document.8". Then RegistryGet("HKEY_CLASSES_ROOT\"+ls_value, "", ls_desc) will return "Microsoft...

How to associate a file to a program not listed in Firefox?
Hello, When I click a media URL for RealPlayer file on a web page, Notepad opens the URL instead by Realplayer to play the audio file in FireFox. How can I make it to open the application Realplayer rather the display the URL in a text editor? The download management list does not have pl type files. Thank you, Athena On 20/11/2007 15:50, Athena wrote: > Hello, > > When I click a media URL for RealPlayer file on a web page, > Notepad opens the URL instead by Realplayer to play the audio file in > FireFox. How can I make it to open the appl...

How to run a file with default associated program
Hello, does anybody know how to run a file with default program from PB10? I want to implement similar functionality what Windows Explorer does when double click on any file. If there is no associated program for given file then Open With... window pops up. Thanks for any help! Yuri Look at the ShellExecute function in the Windows API. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shellexecute.asp Use the "open" value for lpOperation. On 18 Apr 2005 17:38:47 -0700, "Yuri" &...

get icone of an file associate program
Hi evryone, I've got a list of file displayed in a DW for example. For each file (pdf, doc, txt, anything else), I'd like to display the icone of its associated program: For a doc file, I'd like to display berfore the file the word icone, as Outook does for the attachment file. Is this possible ? Tks in advance DW's need bitmaps not .ICO files (.jpgs perhaps also work). The associated app icon is buried in the .EXE as a resource. PB cannot extract resources out of EXEs and DLLs AFAIK directly. The association is located somewhere in the registry. You...

How to get associated programs of a particular file type.
Hi, How can I simulate like windows explorer where I have several files listed in listview. Then display also the icons associated with each file type. When the user double clicks on that file, then it will be opened by the default program associated with that file. When the user right click and then go to "Open With", then it will list all possible programs than can open the particular file. This is more like windows explorer or in the desktop where you can double click on a file then it will be opened... Or right click on it then Open With, then a list of program...

Automatic launch of programs within PowerBuilder by file extension only.
I am running Windows NT with PowerBuilder 6.0 Within my script I would like to launch another application based only on the extension without listing the actual program. Example: Under Explorer/View/Options/File Types, I can establish an automatic launch of a program based on extention. Example .txt would open up WordPad automatically. I do not wish to hardcode for example Word Pad in my program. Just simply the file name and extenion. How do I get PowerBuilder to recognize this existing process? Use the ShellExecute() API call. It does just what you describe. There have b...

Powerbuilder Error when printing
We are experiencing an error 'No association exists for the file' when printing from the PB application. We keep on getting CASE 31 and we've noticed that the DEFAULT printer get's unset, when looking at the List of Printers on Windows. We are running Windows XP and Adobe 9 Powerbuilder 10.5 Here is the code: The issue appears to be on both on .XLS file extensions and .PDF // Print the PDF doc ll_print = ShellExecuteA(handle (parent), "print", istr_parm.s_code, ls_null, ls_null, 1) // Do the error handle IF ll_print <= 32 THEN // Greater t...

Problem printing email
We are running GW 6.5 and Netware 6.5. 3 out of 50 workstations are having this problem. It started when they would try to print an email Adobe Reader would try to open the .tmp file. I deleted the association and now they a box pops up stating "This file does not have a program associated with it". The file again is the .tmp file GW creates. Help Please and Thanx, Craig crfuchs@ati-ae.com wrote: > We are running GW 6.5 and Netware 6.5. 3 out of 50 workstations are > having this problem. > > It started when they would try to print an email Adob...

Changing File-Roller file associations
I don't know how to set/change File-Roller file associations. For instance, if I double-click on a mp3 file Totem will open automatically. But if I double-click on a mp3 throug File-Roller, inside of a rar or zip file, that file will open with Banshee. I don't know how this preference has changed and I want things like they were before: Totem playing those files by default, even when they are inside of an archive. Please help me... thank you :| -- kubric ------------------------------------------------------------------------ It seems more users are w...

superreview requested: [Bug 298930] Create JSS client/server test program to test secure file transfer : [Attachment 189245] JSS_FileUploadClient and JSS_FileUploadServer program to test secure file
Sandeep Konchady <Sandeep.Konchady@Sun.COM> has asked glen beasley <glen.beasley@sun.com> for superreview: Bug 298930: Create JSS client/server test program to test secure file transfer https://bugzilla.mozilla.org/show_bug.cgi?id=298930 Attachment 189245: JSS_FileUploadClient and JSS_FileUploadServer program to test secure file transfer using JSS https://bugzilla.mozilla.org/attachment.cgi?id=189245&action=edit ------- Additional Comments from Sandeep Konchady <Sandeep.Konchady@Sun.COM> This is not part of all.pl, but is a client/server that uses JSS to trans...

Cannot find .msm files in C:\Program Files\Common files\mergemodules directory in windows application
 I made some changes to the windows application using crystal reports which was already developed.After I make changes,i am trying to deploy.I created a setup project and add project files and everything is fine.I need to add 3  crystal report files.I cannot find them.help me how to add them and where can i find.I cannot see them in  C:\Program Files\Common files\mergemodules directory.Please help me out with this.The following 3 crystal report files i am trying to find.Crystal_Database_Access2003.msmCrystal_Database_Access2003_enu.msmCrystal_managed2003.msm Crystal_regwiz2003...

store a regular expression in config file or some other file and have a value associated to it, and use it in code behind file.
How do i store all the regular expressions in a configuration file and use them in code behind file. i.e i need to store a regular expressions with some value associated to it either in config file or any external file .   when i compare that particular regular espression with the input string it should return the value associated to it. ex:System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"\d{1,}"); if (regex.IsMatch(input))return "integer"; here we are hard coding instead have to compare the regular expression t...

superreview granted: [Bug 298930] Create JSS client/server test program to test secure file transfer : [Attachment 189245] JSS_FileUploadClient and JSS_FileUploadServer program to test secure file tr
glen beasley <glen.beasley@sun.com> has granted Sandeep Konchady <Sandeep.Konchady@Sun.COM>'s request for superreview: Bug 298930: Create JSS client/server test program to test secure file transfer https://bugzilla.mozilla.org/show_bug.cgi?id=298930 Attachment 189245: JSS_FileUploadClient and JSS_FileUploadServer program to test secure file transfer using JSS https://bugzilla.mozilla.org/attachment.cgi?id=189245&action=edit ------- Additional Comments from glen beasley <glen.beasley@sun.com> you should put a System.exit(0) at the exits of the the two pr...

Moving a file from the Program Files directory in Vista and above
I'm the developer of an old commercial app written in D7 which stores its settings in an app-specific ini file located in the same folder as the app, which is normally in the Program Files or Program Files (x86) folder. Storing the ini file in the Program Files folder has become a problem for some users on Vista and Win7 due to various issues with rights, and I know it's not a good practice in general. So I want to add some code to the app's startup routine that looks for the ini file in its current location and moves it to the user's ApplicationData folder (aft...

Changing file associations to banshee for .ogg files
Hi! I use 0penSuse 11.0 with gnome. I want to open .ogg-files by double-click with banshee (0.13.2). But when I click on them only banshee opens but does not play anything. I can start banshee first and than choose and open the .ogg out of banshee's menu - so banshee can pay ogg-files generally.:\ (I can choose rhythmbox/vlc ect. instead of banshee but I like looking at big covers when the music plays...;)) So I think I have to alter the "open with" preferences (associations, bindings) with a right-click on a ogg-file and than choose not the "banshee"...

Web resources about - HOW DO I - open a file with the associated program - sybase.powerbuilder.general

Chicago Cop Pleads Not Guilty: Jason Van Dyke Maintains Innocence In Laquan McDonald Shooting
Chicago cop Jason Van Dyke pleaded not guilty in the police shooting death of Laquan McDonald. The white police officer was charged with murder ...


Watch Star Wars Legs sets destroyed at 3,000 fps
What do you do when you've got a few Star Wars Lego sets, some explosives and a high-speed camera? Well, I'm sure there are plenty of creative ...

Country Singer Craig Strickland Reported Missing, Friend Found Dead After Hunting in Storm
Country singer Craig Strickland has been reported missing. The disappearance comes just days after a his friend Chase Morland sent a haunting, ...

Ethan Couch Nabbed In Mexico With His Mom — Duo Hosted Going Away Party Before Flight
Ethan Couch is no longer on the lam. The rich Texas teen who killed four people during a drunk driving accident and got away with only 10 years ...

Amazon's holiday hits included instant film and turntables
You'd think that an internet retail behemoth like Amazon would primarily sell a lot of cutting-edge tech during the holidays, but nope that wasn't ...

Now that Google Glass is enterprise-only, it is more appealing than ever
The first generation of Google Glass spectacularly failed to get off the ground despite a long beta period. The second generation is on the cards, ...

The most expensive rental in San Francisco costs $30,000 per month and sits on the 40th floor of The ...
It's no secret that San Francisco real estate is expensive. In the latest example of the market-gone-crazy, the most expensive listing on the ...

You'll soon be able to shop online using Samsung Pay
Samsung Pay , Samsung's mobile payment service, is going to become a lot more useful to U.S users in the new year. A report from Reuters says ...

Bengals' overtime loss in Denver complicates playoff quest
CINCINNATI (AP) — The Bengals' quest to end their long streak of playoff futility has gotten a lot tougher.

Resources last updated: 12/29/2015 6:57:38 PM