MailItem オブジェクト (Outlook)MailItem object (Outlook)

メール メッセージを表します。Represents a mail message.

注釈Remarks

CreateItem メソッドを使用して、新しいメール メッセージを表す MailItem オブジェクトを作成します。Use the CreateItem method to create a MailItem object that represents a new mail message.

folder プロパティ**** を使用して、フォルダー内のメールアイテムを表す**items** コレクション、および items (index) メソッドを取得し**ます。** _引数 index_には、メールメッセージのインデックス番号、または指定したフォルダーから単一のMailItemオブジェクトを取得するための、メッセージの既定のプロパティ。Use the Folder.Items property to obtain an Items collection representing the mail items in a folder, and the Items.Item (index) method, where index is the index number of a mail message or a value used to match the default property of a message, to return a single MailItem object from the specified folder.

Example

次の Visual Basic for Applications (VBA) の例では、新しいメール メッセージを作成および表示します。The following Visual Basic for Applications (VBA) example creates and displays a new mail message.

Sub CreateMail() 
 
 Dim myItem As Object 
 
 
 
 Set myItem = Application.CreateItem(olMailItem) 
 
 myItem.Subject = "Mail to myself" 
 
 myItem.Display 
 
End Sub

次の VBA の例では、現在のフォルダーを受信トレイとして設定し、フォルダー内の 2 番目のメール メッセージを表示します。The following VBA example sets the current folder as the Inbox and displays the second mail message in the folder. 一般に、フォルダー内のメール メッセージの順序は特定の順序になるとは限りません。In general, the order of mail messages in a folder is not guaranteed to be in a particular order.

Sub DisplayMail() 
 
 Dim myItem As Object 
 
 Dim myFolder As Folder 
 
 
 
 Set myNamespace = Application.GetNamespace("MAPI") 
 
 Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox) 
 
 myFolder.Display 
 
 Set myItem = myFolder.Items(2) 
 
 myItem.Display 
 
End Sub

イベントEvents

名前Name
AfterWriteAfterWrite
AttachmentAddAttachmentAdd
AttachmentReadAttachmentRead
AttachmentRemoveAttachmentRemove
BeforeAttachmentAddBeforeAttachmentAdd
BeforeAttachmentPreviewBeforeAttachmentPreview
BeforeAttachmentReadBeforeAttachmentRead
BeforeAttachmentSaveBeforeAttachmentSave
BeforeAttachmentWriteToTempFileBeforeAttachmentWriteToTempFile
BeforeAutoSaveBeforeAutoSave
BeforeCheckNamesBeforeCheckNames
BeforeDeleteBeforeDelete
BeforeReadBeforeRead
CloseClose
CustomActionCustomAction
CustomPropertyChangeCustomPropertyChange
ForwardForward
OpenOpen
PropertyChangePropertyChange
読み取りRead
ReadCompleteReadComplete
ReplyReply
ReplyAllReplyAll
SendSend
UnloadUnload
WriteWrite

メソッドMethods

名前Name
AddBusinessCardAddBusinessCard
ClearConversationIndexClearConversationIndex
ClearTaskFlagClearTaskFlag
CloseClose
CopyCopy
DeleteDelete
DisplayDisplay
ForwardForward
GetConversationGetConversation
MarkAsTaskMarkAsTask
MoveMove
PrintOutPrintOut
ReplyReply
ReplyAllReplyAll
SaveSave
SaveAsSaveAs
SendSend
ShowCategoriesDialogShowCategoriesDialog

プロパティProperties

NameName
ActionsActions
AlternateRecipientAllowedAlternateRecipientAllowed
アプリケーションApplication
添付ファイルAttachments
AutoForwardedAutoForwarded
AutoResolvedWinnerAutoResolvedWinner
BCCBCC
BillingInformationBillingInformation
BodyBody
BodyFormatBodyFormat
CategoriesCategories
CCCC
クラスClass
CompaniesCompanies
ConflictsConflicts
ConversationIDConversationID
ConversationIndexConversationIndex
ConversationTopicConversationTopic
CreationTimeCreationTime
DeferredDeliveryTimeDeferredDeliveryTime
DeleteAfterSubmitDeleteAfterSubmit
DownloadStateDownloadState
EntryIDEntryID
ExpiryTimeExpiryTime
FlagRequestFlagRequest
FormDescriptionFormDescription
GetInspectorGetInspector
HTMLBodyHTMLBody
ImportanceImportance
InternetCodepageInternetCodepage
IsConflictIsConflict
IsMarkedAsTaskIsMarkedAsTask
ItemPropertiesItemProperties
LastModificationTimeLastModificationTime
MarkForDownloadMarkForDownload
MessageClassMessageClass
MileageMileage
NoAgingNoAging
OriginatorDeliveryReportRequestedOriginatorDeliveryReportRequested
OutlookInternalVersionOutlookInternalVersion
OutlookVersionOutlookVersion
ParentParent
アクセス許可Permission
PermissionServicePermissionService
PermissionTemplateGuidPermissionTemplateGuid
PropertyAccessorPropertyAccessor
ReadReceiptRequestedReadReceiptRequested
ReceivedByEntryIDReceivedByEntryID
ReceivedByNameReceivedByName
ReceivedOnBehalfOfEntryIDReceivedOnBehalfOfEntryID
ReceivedOnBehalfOfNameReceivedOnBehalfOfName
ReceivedTimeReceivedTime
RecipientReassignmentProhibitedRecipientReassignmentProhibited
受信者Recipients
ReminderOverrideDefaultReminderOverrideDefault
ReminderPlaySoundReminderPlaySound
ReminderSetReminderSet
ReminderSoundFileReminderSoundFile
ReminderTimeReminderTime
RemoteStatusRemoteStatus
ReplyRecipientNamesReplyRecipientNames
ReplyRecipientsReplyRecipients
RetentionExpirationDateRetentionExpirationDate
RetentionPolicyNameRetentionPolicyName
RTFBodyRTFBody
SavedSaved
SaveSentMessageFolderSaveSentMessageFolder
SenderSender
SenderEmailAddressSenderEmailAddress
SenderEmailTypeSenderEmailType
SenderNameSenderName
SendUsingAccountSendUsingAccount
SensitivitySensitivity
SentSent
SentOnSentOn
SentOnBehalfOfNameSentOnBehalfOfName
SessionSession
SizeSize
件名Subject
SubmittedSubmitted
TaskCompletedDateTaskCompletedDate
TaskDueDateTaskDueDate
TaskStartDateTaskStartDate
TaskSubjectTaskSubject
ToTo
ToDoTaskOrdinalToDoTaskOrdinal
UnReadUnRead
UserPropertiesUserProperties
VotingOptionsVotingOptions
VotingResponseVotingResponse

関連項目See also

サポートとフィードバックSupport and feedback

Office VBA またはこの説明書に関するご質問やフィードバックがありますか?Have questions or feedback about Office VBA or this documentation? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.