Load assigns writable OLE-compatible properties stored in the Objects collection item Name to the tested object Object provided that the properties of that object are compatible with the collection item’s properties. If an error occurs when loading (for example, the specified object or its property is not found),
Load returns False and generates an error string, which you can retrieve from the
LastError property of the
Objects object (and post it to the test log).
Objects.Load(Object, Name, PropNames, ExceptedPropName, Recursive)
|Object||[in]||Required||a tested object|
|PropNames||[in]||Optional||String||Default value: Empty string|
|ExceptedPropName||[in]||Optional||String||Default value: Empty string|
|Recursive||[in]||Optional||Boolean||Default value: False|
The method is applied to the following object:
The method has the following parameters:
The tested object whose properties you want to re-assign from the object referred to by the Name item of the Objects collection.
Unique name of the Objects collection’s item from which you want to load the needed properties.
A string that contains the names of Object’s properties that should be re-assigned to Object. The property names specified in this string must be separated by spaces. If PropNames is not specified or is an empty string (this is the default value), all the stored writable properties will be restored to Object.
A string that contains the names of Object’s properties that should not be re-assigned to Object. The property names specified in this string must be separated by spaces. This parameter is useful when you want to restore most of the object’s properties because in this instance you only need to set a short “exception list” of undesired properties, which saves you from listing all of the properties to be restored. If ExceptedPropNames is not specified or is an empty string (this is the default value), no specific writable properties will be missed when restoring properties of Object.
The ExceptedPropNames and PropNames parameters are mutually exclusive. So, the ExceptedPropNames and PropNames parameters cannot have a value at the same time. If these parameters have a non-empty value at the same time, the method returns
False and generates an error description, which you can retrieve from the
LastError property of the
If it is False (the default), only properties of the Object object will be restored. If this parameter is True, all the properties of the object’s child objects will be restored as well.
True, if the properties’ values were assigned successfully, and False otherwise.
To save collections of an object’s properties, use the
The following code loads all the properties of the specified object from an item stored in the Objects collection.