Save all attachments to specified directory.
[Syntax] C++: HRESULT SaveAllAttachments( BSTR sPath, long* pVal ) Visual Basic: SaveAllAttachments( sPath As String ) As long C#: long SaveAllAttachments( string sPath )
Parameters
sPath
Path to the attachment is saved.
Return Value
Return value is the total count of all attachments saved. If the specified directory doesn't exist, this method returns zero.
Usage Example
[Visual Basic]
Dim oMsg As Object
Dim tempFolder As String
tempFolder = "c:\attachments_temp"
Set oMsg = CreateObject("ANPOP.POPMSG")
If oMsg.CreateFolder( tempFolder ) <> 0 Then
MsgBox "error with create temporary directory"
'Exit Sub
End If
If oMsg.ImportFile( "c:\test.eml" ) = 0 Then
MsgBox "total " & oMsg.SaveAllAttachments( tempFolder ) & " saved"
Else
MsgBox "error with ImportFile"
End If
See Also
2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.