Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Proporciona acceso a la funcionalidad que le permite enviar documentos como mensajes de correo electrónico directamente desde aplicaciones de Microsoft Office.
Observaciones
Utilice la propiedad MailEnvelope del objeto Document , el objeto Chart o el objeto Worksheet (dependiendo de la aplicación que use) para devolver un objeto MsoEnvelope .
Ejemplo
En el ejemplo siguiente se envía el documento de Microsoft Word activo como mensaje de correo electrónico a la dirección de correo electrónico que se pasa a la subrutina.
Sub SendMail(ByVal strRecipient As String)
'Use a With...End With block to reference the MsoEnvelope object.
With Application.ActiveDocument.MailEnvelope
'Add some introductory text before the body of the email.
.Introduction = "Please read this and send me your comments."
'Return a Microsoft Outlook MailItem object that
'you can use to send the document.
With .Item
'All of the mail item settings are saved with the document.
'When you add a recipient to the Recipients collection
'or change other properties, these settings persist.
.Recipients.Add strRecipient
.Subject = "Here is the document."
'The body of this message will be
'the content of the active document.
.Send
End With
End With
End Sub
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.