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(olFol derInbox)
Set oMyExplorer = oMyinbox.GetExplorer
oMyExplorer.Search EMail_txt.Text, olSearchScopeAllOutlookIte ms
oMyExplorer.Display
End Sub
Any ideas on this would be very helpfull
Jack
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(olFol
Set oMyExplorer = oMyinbox.GetExplorer
oMyExplorer.Search EMail_txt.Text, olSearchScopeAllOutlookIte
oMyExplorer.Display
End Sub
Any ideas on this would be very helpfull
Jack
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
I will give your post a try and respond as to the results.
Jack
ASKER
Thank you mbizup,
The program is working fine now. I appreciate you giving me the last piece of the puzzle.
Jack
The program is working fine now. I appreciate you giving me the last piece of the puzzle.
Jack
ASKER
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