Set Statement

Sets an object reference on a variable or a Property.

Syntax:


Set ObjectVar = Object

Parameters:

ObjectVar: a variable or a property that requires an object reference.

Object: Object to which the variable or the property refers.

Nothing - Assign the Nothing object to a variable to remove a previous assignment.

Example:


Sub ExampleSet
Dim oDoc As Object
    Set oDoc = ActiveWindow
    Print oDoc.Name
End Sub

Please support us!