Visual Basic para Aplicaciones - visual basic outlook

Life is soft - evento anual de software empresarial
 
Vista:

visual basic outlook

Publicado por javi (1 intervención) el 28/02/2002 18:29:41
me gustaria saber como puedo coger un fichero cualquiera y desde el visual basic utiliar el outlook para que me lo envie, todo esto haciendolo automaticamente desde un boton
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:visual basic outlook

Publicado por Mauricio Baeza (262 intervenciones) el 29/03/2002 14:17:04
Hola, con este codigo lo logras...

Option Explicit

Public Sub EnviarCorreoConAnexo()
Dim myOlapp As Object
Dim myItem As Object
Dim myAttach As Object
Dim wbTmp As Workbook
Dim strRuta As String

Const olMailiTem As Integer = 0
Const olByValue As Integer = 1

Set myOlapp = CreateObject("Outlook.Application")
Set myItem = myOlapp.CreateItem(olMailiTem)
Set myAttach = myItem.Attachments

strRuta = App.Path & "\Mi Archivo.abc"

myAttach.Add strRuta, olByValue, 1, "Ejemplo de archivo anexo"
myItem.Subject = "Prueba de mensaje"
myItem.body = "Cuerpo del mensaje"
myItem.to = "[email protected]"
myItem.display

Set myOlapp = Nothing
Set myItem = Nothing
Set myAttach = Nothing

End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar