Descargar ficheros de un correo con VB

Me llamo José Enrique. Mi pregunta es:
¿Cómo descargo en un directorio los ficheros de un correo leido con el control MAPIMessages? ¿Es usando la propiedad Atachtment? ¿cómo hacerlo?
Agradecería mucho tu ayuda. Gracias.
1

1 Respuesta

14.025 pts.
Aquí tienes ejemplos:
Function CopyFiles(MfIn As MapiFile, MfOut As MapiFile) As Long
MfOut.FileName = MfIn.FileName
MfOut.PathName = MfIn.PathName
MfOut.Reserved = MfIn.Reserved
MfOut.Flags = MfIn.Flags
MfOut.Position = MfIn.Position
MfOut.FileType = MfIn.FileType
CopyFiles = 1&
End Function
Function MAPIReadMail(Session As Long, UIParam As Long, MessageID As
String, Flags As Long, Reserved As Long, Message As MAPIMessage, Orig As
MapiRecip, RecipsOut() As MapiRecip, FilesOut() As MapiFile) As Long
Dim Info&
Dim nFiles&, nRecips&
rc& = BMAPIReadMail(Info&, nRecips, nFiles, Session, 0, MessageID,
Flags, Reserved)
If (rc& = SUCCESS_SUCCESS) Then
'Message is now read into the handles array. We have to redim the
'arrays and read the information in.
If (nRecips = 0) Then nRecips = 1
If (nFiles = 0) Then nFiles = 1
ReDim Recips(0 To nRecips - 1) As MapiRecip
ReDim Files(0 To nFiles - 1) As MapiFile
rc& = BMAPIGetReadMail(Info&, Message, Recips(), Files(), Orig)
'*******************************************
' Copy Recipient and File structures from
' Local structures to those passed as
' Parameters
'*******************************************
ReDim FilesOut(0 To nFiles - 1) As MapiFile
ReDim RecipsOut(0 To nRecips - 1) As MapiRecip
For i = 0 To nRecips - 1
ignore& = CopyRecipient(Recips(i), RecipsOut(i))
Next i
For i = 0 To nFiles - 1
ignore& = CopyFiles(Files(i), FilesOut(i))
Next i
End If
MAPIReadMail = rc&
End Function

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas