Partager via


_Application.GetObjectReference Method

Creates a strong or weak object reference for a specified Outlook object.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
Function GetObjectReference ( _
    Item As Object, _
    ReferenceType As OlReferenceType _
) As Object
'Usage
Dim instance As _Application
Dim Item As Object
Dim ReferenceType As OlReferenceType
Dim returnValue As Object

returnValue = instance.GetObjectReference(Item, _
    ReferenceType)
[DispIdAttribute()]
Object GetObjectReference(
    Object Item,
    OlReferenceType ReferenceType
)

Parameters

  • Item
    Type: System.Object

    The object from which to obtain a strong or weak object reference.

Return Value

Type: System.Object
An Object that represents a strong or weak object reference for the specified object.

Remarks

This method returns a weak or strong object reference for the object specified in Item.

Note

Outlook can fail to close successfully if an add-in retains strong object references. Always dereference a strong object reference once it is no longer needed by the add-in.

See Also

Reference

_Application Interface

_Application Members

Microsoft.Office.Interop.Outlook Namespace