Launching Web browser from script

In order to open an HTML page in the default browser (or send an email) from a script, it is necessary to call Windows function ShellExecute. This is an easy task for CorelSCRIPT. First, you should declare the function like this:

DECLARE SUB ShellExecute LIB "shell32" \\
	(BYVAL hWnd&,BYVAL Operation&,BYVAL File$,BYVAL Parameters&,\\
	BYVAL Directory&,BYVAL Show&) ALIAS "ShellExecuteA"

Then call it as shown in the example below.

ShellExecute 0,0,"",0,0,0

To send an email from script, call ShellExecute this way:

ShellExecute 0,0,"",0,0,0

[ CorelSCRIPT Tips&Tricks | Learning CorelSCRIPT | Oberon Home Page ]

Copyright 2000 by Alex Vakulenko. All rights reserved.
This page was last revised on 11/25/02.