by KA Bucci (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 23rd February 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Allows the attachment of more than one file to an email message, selected from a file list box.
API Declarations
'*** Module Level Code for Array***
Type Attach
Acount As Integer
Aname As String
Aposition As Integer
Apath As String
End Type
Global Attachments(1 To 10) As Attach
Global Counter
'Load Array with attachments. Use this code on a file list box Click event.
Private Sub File1_Click()
Counter = Counter + 1
Attachments(Counter).Acount = Counter
Attachments(Counter).Aname = File1.FileName
Attachments(Counter).Apath = Dir1.Path + "\" + File1.FileName
Attachments(Counter).Aposition = Counter
End Sub
'Use this code in a click event for a button or other control to set the
'attachments. Additional code is required to actually send the email using the
'MAPI control.
Rem Attachment
If Counter < 1 Then
Else
For A = 1 To Counter
MAPIMessages1.MsgIndex = -1
MAPIMessages1.AttachmentIndex = Attachments(A).Acount - 1
MAPIMessages1.AttachmentName = Attachments(A).Aname
MAPIMessages1.AttachmentPathName = Attachments(A).Apath
MAPIMessages1.AttachmentType = 0
Next A
End If
No comments have been posted about Allows the attachment of more than one file to an email message, selected from a file list box.. Why not be the first to post a comment about Allows the attachment of more than one file to an email message, selected from a file list box..