Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SharingItem Object
Collapse the table of content
Expand the table of content

SharingItem Object (Outlook)

Represents a sharing message in an Inbox folder.

Version Added: Outlook 2007

Use the CreateSharingItem method of the NameSpace object to create a SharingItem object that represents a new sharing request or sharing invitation.

Use Item (index), where index is the index number of a sharing message or a value used to match the default property of a message, to return a single SharingItem object from an Inbox folder.

The following Visual Basic for Applications (VBA) example creates and displays a new sharing invitation for the Tasks folder.

Public Sub CreateTasksSharingItem() 
 
 
 
 Dim oNamespace As NameSpace 
 
 Dim oFolder As Folder 
 
 Dim oSharingItem As SharingItem 
 
 
 
 On Error GoTo ErrRoutine 
 
 
 
 Set oNamespace = Application.GetNamespace("MAPI") 
 
 Set oFolder = oNamespace.GetDefaultFolder(olFolderTasks) 
 
 Set oSharingItem = oNamespace.CreateSharingItem(oFolder) 
 
 
 
 oSharingItem.Display 
 
 
 
EndRoutine: 
 
 On Error GoTo 0 
 
 Set oSharingItem = Nothing 
 
 Set oFolder = Nothing 
 
 Set oNamespace = Nothing 
 
Exit Sub 
 
 
 
ErrRoutine: 
 
 MsgBox Err.Description, _ 
 
 vbOKOnly, _ 
 
 Err.Number & " - " & Err.Source 
 
 GoTo EndRoutine 
 
End Sub 
 

Show:
© 2015 Microsoft