Application_ViewDocument Event

Scope: Schematic editor

Object: Property Object

The Application_ViewDocument event is used in a DataBook script to dynamically build URLs to web pages.

Usage

Sub Application_ViewDocument (ByVal arg1 As Object, ByVal arg2 As Object)

Arguments

arg1

A row of properties selected in the Component Search results window.

arg2

A property containing the document you want to view.

Description

Applies to the Properties objects (see Property Object), and is called by the script when you click a Web page link and before the document viewer launches, so that it can build a URL.

Note:

Enumerated values are not automatically available in a script file, so you must specify the numeric values for this data type (for example, VDM_COMP = 128).

Examples

This example launches notepad to view the document specified in the DataBook Document field:

Note:

Mentor Graphics recommends that you use COM versioning syntax in script examples that use GetObject and CreateObject. Without COM versioning, the script will access the last installation to which the release switcher pointed.

Function Application_ViewDocument(properties, document) 
   ' 
   ' 
   set wsh = CreateObject("WScript.Shell")  
   ' Searches path for notepad.exe 
   wsh.Run("notepad.exe " & "C:\DataSheets\" & document.Value)  
   ' set the document value to empty ("") to prevent DataBook  
   ' from launching the viewer 
End Function 
 
Note:

You can use directory pointers to point to a central data sheet repository, as shown in the example.