Objeto MailItem (Outlook)

Representa un mensaje de correo.

Comentarios

Use el método CreateItem para crear un objeto MailItem que represente un nuevo mensaje de correo.

Utilice la propiedad Folder.Items para obtener una colección Items que represente los elementos de correo de una carpeta y el método Items.Item (índice), donde index es el número de índice de un mensaje de correo o un valor usado para coincidir con la propiedad predeterminada de un mensaje, para devolver un único objeto MailItem de la carpeta especificada.

Ejemplo:

En el siguiente ejemplo de Visual Basic para Aplicaciones(VBA) se crea y se muestra un nuevo mensaje de correo.

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

El siguiente ejemplo de VBA establece la carpeta actual como la Bandeja de entrada y muestra el segundo mensaje de correo en la carpeta. En general, no se garantiza que los mensajes de correo en una carpeta tengan un orden determinado.

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

Eventos

Nombre
AfterWrite
AttachmentAdd
AttachmentRead
AttachmentRemove
BeforeAttachmentAdd
BeforeAttachmentPreview
BeforeAttachmentRead
BeforeAttachmentSave
BeforeAttachmentWriteToTempFile
BeforeAutoSave
BeforeCheckNames
BeforeDelete
BeforeRead
Close
CustomAction
CustomPropertyChange
Reenviar
Open
PropertyChange
Lectura
ReadComplete
Reply
ReplyAll
Send
Unload
Write

Métodos

Nombre
AddBusinessCard
ClearConversationIndex
ClearTaskFlag
Close
Copy
Delete
Display
Reenviar
GetConversation
MarkAsTask
Move
PrintOut
Reply
ReplyAll
Save
SaveAs
Send
ShowCategoriesDialog

Propiedades

Nombre
Actions
AlternateRecipientAllowed
Application
Archivos adjuntos
AutoForwarded
AutoResolvedWinner
BCC
BillingInformation
Body
BodyFormat
Categorías
CC
Class
Companies
Conflicts
ConversationID
ConversationIndex
ConversationTopic
CreationTime
DeferredDeliveryTime
DeleteAfterSubmit
DownloadState
EntryID
ExpiryTime
FlagRequest
FormDescription
GetInspector
HTMLBody
Importance
InternetCodepage
IsConflict
IsMarkedAsTask
ItemProperties
LastModificationTime
MarkForDownload
MessageClass
Mileage
NoAging
OriginatorDeliveryReportRequested
OutlookInternalVersion
OutlookVersion
Parent
Permiso
PermissionService
PermissionTemplateGuid
PropertyAccessor
ReadReceiptRequested
ReceivedByEntryID
ReceivedByName
ReceivedOnBehalfOfEntryID
ReceivedOnBehalfOfName
ReceivedTime
RecipientReassignmentProhibited
Destinatarios
ReminderOverrideDefault
ReminderPlaySound
ReminderSet
ReminderSoundFile
ReminderTime
RemoteStatus
ReplyRecipientNames
ReplyRecipients
RetentionExpirationDate
RetentionPolicyName
RTFBody
Saved
SaveSentMessageFolder
Sender
SenderEmailAddress
SenderEmailType
SenderName
SendUsingAccount
Sensitivity
Sent
SentOn
SentOnBehalfOfName
Session
Size
Subject
Submitted
TaskCompletedDate
TaskDueDate
TaskStartDate
TaskSubject
To
ToDoTaskOrdinal
UnRead
UserProperties
VotingOptions
VotingResponse

Vea también

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.