SharingItem object (Outlook)

Represents a sharing message in an Inbox folder.

Remarks

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.

Example

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

Public Sub CreateTasksSharingItem() 
 On Error GoTo ErrRoutine 
 
 Dim mapiNamespace As Outlook.NameSpace 
 Set mapiNamespace = Outlook.Application.GetNamespace("MAPI") 
 
 Dim tasksFolder As Outlook.Folder 
 Set tasksFolder = mapiNamespace.GetDefaultFolder(Outlook.olFolderTasks) 
 
 Dim invitation As Outlook.SharingItem  
 Set invitation = appNamespace.CreateSharingItem(tasksFolder) 
 
 invitation.Display 
  
EndRoutine:  
 Exit Sub 
  
ErrRoutine: 
 MsgBox Err.Description, vbOKOnly, Err.Number & " - " & Err.Source  
 Resume EndRoutine 
 
End Sub 

Events

Methods

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.