Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Can NRS Script call external process?
robcom
I wish to call an external process (DLL.sub) if the value of a filed is changed to a particular value. Can this be done?
Initial experiments to Call/Run/Exec a simple test.exe fail when I enter in a line in the .nrs script like:
Sub EditProfileDlg_OnOK(dlg)
MsgBox "Edit ProfileDlg Fire OnOK"
'Test for value...
Call C:\temp\test.exe
End Sub
Has anyone achieved this?
Find more posts tagged with
Comments
DaleN
You can call an external process from NRS / VBScript using the Windows Script Host object (reference materials should be available on Microsoft's MSDN website). Here's a sample that launches the Viewer application:
Option Explicit
Const nrClass = 8
Sub EditProfileDlg_OnOK(pDlg)
Dim objClass
Dim WshShell
Set objClass = pDlg.GetAttributeByID(nrClass)
If objClass.Name = "DOC" Then
Set WshShell = CreateObject("WScript.Shell")
'Note: need two additional sets of double quotes when launching applications in paths that include spaces (i.e. 3 sets in total on each end)
WshShell.Run """C:\Program Files\Interwoven\WorkSite\view32.exe"""
End If
End Sub