Article ID: 186148
Article Last Modified on 6/24/2004
Sub Main()
'Logon & Sync
MAPISession1.SignOn
'Create Message w/Attachments then Send
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose
.MsgSubject = "OCX - Test Message"
.RecipDisplayName = "YourRecipientNameHere"
.ResolveName
'The value 2 is passed to the Space() function in the
'next line because there are two attachments to add.
'These spaces act as placeholders for the attachments.
.MsgNoteText = _
Space(2) & vbCrLf & _
"This message was sent from the MSMAPI32.OCX." & vbCrLf & _
"This message contains 2 attachments."
'Replace the AttachmentPathName values below as applicable...
.AttachmentIndex = 0
.AttachmentPosition = 0
.AttachmentPathName = ("c:\test1.txt")
.AttachmentIndex = 1
.AttachmentPosition = 1
.AttachmentPathName = ("c:\test2.txt")
.Send
End With
MAPISession1.SignOff
End Sub
Additional query words: kbDSupport kbMsg kbCtrl kbMAPI kbvbp400 kbvbp500
Keywords: kbprb KB186148