Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

URGENT : MAPI32 API for use in VB (more points possible)

Posted on 2000-02-29
10
Medium Priority
?
261 Views
Last Modified: 2008-03-17
I need to do the following with MAPI32 API (please send detailed VB code) :

1) LogOn
2) Fetch all emails from the default email client's in-box and search for all emails that have attachments (get the FileCount to know how many attachments an e-mail contains)
4) Retrieve the FileName, FilePath, Position of these attachments
5) Retrieve the name of the Sender, the Subject, NoteText, DateReceived and ConversationID of emails.
6) LogOff

This code should work with the following email clients : Outlook, Outlook Express, Exchange, Netscape.
More points may be available if the answer is very good.
Thank you.
Minette
0
Comment
Question by:minette
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
10 Comments
 
LVL 3

Expert Comment

by:carruina
ID: 2570502
Try with this code:



Private Sub Command1_Click()
MAPISession.SignOn
DoEvents
MAPIMensaje.SessionID = MAPISession.SessionID
'MAPIMensaje.FetchUnreadOnly = True
MAPIMensaje.Fetch
For i = MAPIMensaje.MsgCount - 1 To 0 Step -1
    MAPIMensaje.MsgIndex = i
    If MAPIMensaje.AttachmentCount >= 1 Then
        'Retrieve the name of the Sender, the Subject, NoteText, DateReceived and ConversationID of emails.
        MsgBox MAPIMensaje.MsgConversationID
        MsgBox MAPIMensaje.MsgOrigAddress
        MsgBox MAPIMensaje.MsgSubject
        MsgBox MAPIMensaje.MsgNoteText
        MsgBox MAPIMensaje.MsgDateReceived
        'Retrieve the FileName, FilePath, Position of these attachments
        For j = 0 To MAPIMensaje.AttachmentCount - 1
            MAPIMensaje.AttachmentIndex = j
            'In NT AttachmentName <> AttachmentPathName
            'In W95 some timmes AttachmentName = AttachmentPathName
            MsgBox MAPIMensaje.AttachmentName
            MsgBox MAPIMensaje.AttachmentPathName
            MsgBox MAPIMensaje.AttachmentPosition
        Next j
    End If
Next i
MAPISesion.SignOff
End Sub
0
 

Author Comment

by:minette
ID: 2570855
I need to achieve this only with API calls, not with the MAPI ocx.
0
 

Author Comment

by:minette
ID: 2571064
Outlook Express 5.0 and Netscape don't support MAPIMensaje.AttachmentCount

I need a solution with API calls, not the OCX.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:minette
ID: 2572895
Ruchi,
Sorry but the URL you gave is for sending mail.
What I need is to read email from the in-box and have access to their attachments.
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2577101
I don't think there is to achieve this problem with API calls.

for MAPI ocx.

Go to:
http://members.home.com/abstractvb/vbcode/vbc-tut-mapi.htm
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2577122
Or, if you don't want to use MAPI, you can use socket..

go to
http://members.home.com/abstractvb/vbcode/vbc-net-smtp.htm
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2577142
0
 
LVL 9

Accepted Solution

by:
Ruchi earned 750 total points
ID: 2577158
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2603383
Minette: Where are you? Please post something so we could be of any help to you. Thank you very much.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question