DocumentItem Object

DocumentItem
Multiple objects

A DocumentItem object is any document other than a Microsoft Outlook item as an item in an Outlook folder. In common usage, this will be an Office document but may be any type of document or executable file.

Note  When you try to programmatically add a user-defined property to a DocumentItem object, you receive the following error message: "Property is read-only." This is because the Outlook object model does not support this functionality.

Example

The following Visual Basic for Applications (VBA) example shows how to create a DocumentItem.

Sub AddDocItem()
    Dim outApp As New Outlook.Application
    Dim nsp As Outlook.NameSpace
    Dim mpfInbox As Outlook.MAPIFolder
    Dim doci As Outlook.DocumentItem
    
    Set nsp = outApp.GetNamespace("MAPI")
    Set mpfInbox = nsp.GetDefaultFolder(olFolderInbox)
    Set doci = mpfInbox.Items.Add(olWordDocumentItem)
    doci.Subject = "Word Document Item"
    doci.Save
End Sub

Properties | Actions Property | Application Property | Attachments Property | AutoResolvedWinner Property | BillingInformation Property | Body Property | Categories Property | Class Property | Companies Property | Conflicts Property | ConversationIndex Property | ConversationTopic Property | CreationTime Property | DownloadState Property | EntryID Property | FormDescription Property | GetInspector Property | Importance Property | IsConflict Property | ItemProperties Property | LastModificationTime Property | Links Property | MarkForDownload Property | MessageClass Property | Mileage Property | NoAging Property | OutlookInternalVersion Property | OutlookVersion Property | Parent Property | Saved Property | Sensitivity Property | Session Property | Size Property | Subject Property | UnRead Property | UserProperties Property

Methods | Close Method | Copy Method | Delete Method | Display Method | Move Method | PrintOut Method | Save Method | SaveAs Method | ShowCategoriesDialog Method

Events | AttachmentAdd Event | AttachmentRead Event | BeforeAttachmentSave Event | BeforeCheckNames Event | BeforeDelete Event | Close Event | CustomAction Event | CustomPropertyChange Event | Forward Event | Open Event | PropertyChange Event | Read Event | Reply Event | ReplyAll Event | Send Event | Write Event

Parent Objects

Child Objects | Actions Object | Attachments Object | Conflicts Object | FormDescription Object | ItemProperties Object | Links Object | UserProperties Object