Nt and launching applicatons (OpenInsight Specific)
At 09 JAN 2000 09:38:21PM Ray Chan wrote:
We would like our application to launch documents (word, excel etc) without user intervention.
We have been unable to get OI to do this using utility and RUNWIN. We can so ..
rtn=Utility("RUNWIN","E:\PROGRA~1\MICROS~1\OFFICE\WINWORD.EXE")
but
1) since each company who buys the product may have word installed in differing directories hard coding this doesn't seem to make a lot of sense (note I have put it in E and not the default of c)
2) I want a specfic document to launch. Shouldn't I be able to
rtn=Utility("RUNWIN","E:\anydir\worddoc.doc")
and 'expect' the windows registry to 'know' where is is going? How do all the other apps in the world (oi or other environments) handle this.
Thanks ..
ps .. i am also posting this in the works section
At 09 JAN 2000 10:25PM Bob Carten, WinWin Solutions Inc. wrote:
Ray:
It's that 16-bit thing.
Office registers itself in the registry, RUNWIN can't check there.
If you run your document from the NT RUN command line it will open.
IF you have Internet Explorer 5.0 , or you have the windows scripting host, then
you can write a quick vbScript wrapper that will behave like the RUN line, and open your documents.
I only allowed one argument here, modify it to build a string out of Wsh.Arguments if you want more
Step 0:
Get the scripting host via IE5 or msdn.microsoft.com/scripting
Step 1:
Save the following as runit.vbs in your OpenInsight subdirectory
' ————–
'Runit.vbs
' Pass it a registerd file type, e.g MyWord.doc and it will run the document
' RJC 01-09-2000
'—————
Dim oShell
set oshell=Wscript.CreateObject( "WScript.Shell" )
cmd=Wsh.Arguments(0)
'Wscript.Echo cmd
oShell.Run(cmd)
set oshell=nothing
Step 2:
In OpenInsight write a function like
subroutine RunFile(dosfile)
*
* Call vbScript to open documents via registry
*
Declare Function UnAssigned, Utility
If Unassigned(dosfile) then dosfile='
if len(dosfile) then
ntCmd=runit.vbs ':dosfilex=Utility("RUNWIN",dosfile)end
Step three
From your code
call RunFile("Mypath\MyWord.Doc")
or the system monitor try:
run Runfile "MyPath\MyWord.doc"
Note:
This works from Arev too. (Think you must download scripting host)
If you have the scripting host you can
SUSPEND EXIT CSCRIPT RUNFILE MYFILE.DOC to open word, excel, notepad, etc.
Hope this helps.
Bob
At 10 JAN 2000 09:51AM Ray Chan wrote:
Bob,
First .. let me thank you for the quick response and the hack.
Upon further investigation, I found a thread between DSig (David Sigafoos) and Cameron Purdy which showed a OI resolution.
The information is in the WORKS section so I wont reveal it here but look for the thread 'OPENDOC'.
Thanks again
At 10 JAN 2000 02:39PM Vince Poirier wrote:
You actually don't need to use WSH for this.
Windows '9x has the feature built in.
In OI, use:
Utility('RUNWIN', 'start c:\whatever.doc')In AREV, use:
SUSPEND EXIT START c:\whatever.docVince