Description
Document scripts enable you to view, open or print documents. If you created the scripts in Isah, you can start the scripts via a document object.
Creating Document scripts
If you create document scripts in Isah, you can view, open or print documents. In Isah no standard scripts for viewing, opening or printing documents are present. You have to create custom made document scripts. The scripts must meet certain conditions. In order for the script to run via the Document Link, the script code must contain a function with a fixed name and input parameters.
Link the scripts to one of the document actions in Isah:
Link the document actions to document types in Isah. This enables you, for example, to open word processor documents and CAD documents in separate applications.
Example
The following example shows an Isah script that opens a document:
Sub DocLinkOpen(DocId, DocPathName)
Dim ShellObj
‘’ Check whether a file name is valid.
if DocPathName = "" then
MsgBox "No file name entered", vbOKOnly+vbCritical,, ”Documents"
Exit Sub
end if
Set ShellObj = CreateObject("WScript.Shell")
ShellObj.Run """" & DocPathName & """"
Set ShellObj = Nothing
End Sub
Running Document Scripts via Document Object
You can run the document script from a document object, using one of the following methods:
You can use the DocId and DocPathName values to identify the document the script applies to.
Example
The code in the following example starts an Open document script:
Dim oDocument As IDMLink.Document
Set oDocument = New IDMLink.Document
oDocument.DocId = 224538
Try
oDocument.Refresh()
oDocument.Open()
Catch ex As Exception
MsgBox "Document 224538 is not present."
End Try