Use lotus scripts to launch applications

I want to create a lotus script, if the attachment is text file, automatically launch the "notepad.exe", if a wav, launch "recorder", if a doc, launch "word", etc. Just like the "launch" button shown in attachment tab works. Is that possible? in the program, first, detach the attachment to a specified location, this is easy to be done, second, launch programs corresponding to the file type, and open the file.
LVL 2
zhangjingAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HemanthaKumarCommented:
Yes you can do that by using 'shell' command in lotus script.

Syntax: shell( "program name <filename>",windowstyle)

eg:  t% = Shell ("notepad.exe \Chipset.txt",1)

Good Luck
Hemanth
0
zhangjingAuthor Commented:
Yes, I know the Shell function.

But how can I know what is attached to my document? Maybe it's a text file, maybe it's a bitmap, maybe it's a Word......

I want to open different file with different applications, just like the "launch" button do in "Attachment" dialog.

I can't use @Command too, because I want to control where the file will be extract too.
0
HemanthaKumarCommented:
Detach the file to a temp directory and pass the filename to the shell function. The file will be opened with the registered application, if file type is not registered, windows will prompt for the application.

Hemanth
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

zhangjingAuthor Commented:
This is what I copied from the Notes help. You know the Shell can't work.

Syntax
Shell ( program [ , windowStyle ] )
Elements
program
A string expression whose value is the name of the program to run, including arguments. program be the name of an executable file that uses a file name extension of BAT, COM, PIF, or EXE. You can omit the file name extension, and you can optionally include a complete path specification.
Using an internal DOS command name generates an error.
0
brelCommented:
This "dirty code" it might work.
I've use it in MS Access to launch different files regardless were the registrered application is installed.

Call Shell(Environ$("COMSPEC") & " /c START <detached_file>", 6)

It works fine in NT4 and should also work in W9x.

/Brel
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zhangjingAuthor Commented:
Thank you very much! It works! Although a little ugly, everytime it will first show a black DOS screen, is there anyway to "hide" it? That will be more better. :)
0
brelCommented:
In NT4 the DOS screen opens and closes directly then the application is launched. The behavior on W9x I haven't tested.

Your welcome
/Brel
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.