Some examples of VBA scripts used for accessing section variables using “Variable Data Exchange Methods” ar given.
Example 1: Obtaining a Section variable
Function GetSectionLaborCost(branchName, sectionName) As Double
Dim var1 As Variant
Dim var2 As Variant
Dim str1 As String
Dim str2 As String
str1 = CStr(branchName)
str2 = CStr(sectionName)
Set SuperProDoc = DocumentObject()
SuperProDoc.GetSectionVarVal str1, str2, VarID.laborCost_VID, var1
GetSectionLaborCost = CDbl(var1)
End Function
The above script is an example of a function that returns the value of the labor cost for a section