Link to home
Start Free TrialLog in
Avatar of JackVannoy
JackVannoy

asked on

Retrive Deleted Email Items from Outlook 2007 and 2010 with VB6

NOTE: Chris (craisin) was very helpful in getting me on the right track for the original question that resulted in the code I am listing below.

I have a program that will access MS Outlook from an email address in a text box.  It is working fine in 2010 for the Inbox, Personal Folders, and the Sent Items.  In 2007 it only retrieves data from the Personal Folders.

List below is the code for 2010

 Option Explicit
    '=== For accessing all correspondence for a specifice email address ==================
    Private oOutapp      As outlook.Application
    Private oNs          As outlook.NameSpace
    Private oMyinbox     As outlook.MAPIFolder
    Dim oMyExplorer      As outlook.Explorer
    '==========================================================================

Private Sub SeeEmailInfo_btn_Click()
 
    If Trim(EMail_txt.Text) = "" Then
        MsgBox "No email address assigned to this customer", vbOKOnly
        Exit Sub
    End If
   
    Set oOutapp = New outlook.Application
    Set oNs = oOutapp.GetNamespace("MAPI")
    Set oMyinbox = oNs.GetDefaultFolder(olFolderInbox)
    Set oMyExplorer = oMyinbox.GetExplorer
    oMyExplorer.Search EMail_txt.Text, olSearchScopeAllOutlookItems
    oMyExplorer.Display

End Sub

Any ideas on this would be very helpfull

Jack
Avatar of JackVannoy
JackVannoy

ASKER

I have an open question that shows it was posted on 05/04/2011.  The question was a new question, with a new probolem,  that followed up on a question that was resolved and accepted.  the expert who provided the answer for the first queston was Chris (craisin)

Just curious about the lack of response to this question  I have not receieved and responses as of today 05/09/2011. Guess I want to know what I should do. I think I may have put in the wrong zone.  It should have been either Visual Basic Classic or Prog Language.

Jack
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you mbizup for your response and for reminding me of the (Request Attention) button.

I will give your post a try and respond as to the results.

Jack
Thank you mbizup,

The program is working fine now.  I appreciate you giving me the last piece of the puzzle.

Jack