WriteVars - property of object PmCommMsg

The property returns an object of the Collection type whose items are objects of the Var type that contain information (value, name, index, etc.) about the variable defined on the Data-sent page.
WriteVars As Object
Writing the value into the third variable:
oMsg.WriteVars.Item(2).Value = val 'or
oMsg.WriteVars.Item("xy").Value = val
Property access for read only.

As the parameter of the Item property either the index of the variable (zero-based index) or the name of the variable (data type String, case sensitive text) can be entered.

The WriteVars property cannot be changed (for example another set cannot be assigned). But it is possible to change properties of the objects in this collection, which means for example that values of the variables can be changed.

Instead of the WriteVars property, it is usually better to use the #sndvars identifier, see Example.
See also:
Values of the variables of the PmData object will be copied into the variables on the Data-sent page.
Dim oWrite, oData, i
Set oWrite = pMe.Pm("/Comm/Msg1").WriteVars
' Set oWrite = pMe.Pm("/Comm/Msg1/#sndvars") ' The second and easier way of getting the object containing the variables of the Data-sent page
Set oData = pMe.Pm("/Data")
For i=0 To oData.Count
  oWrite.Item(i).Value = oData.Item(i).Value
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice