I have used VBA to download all email address I have sent and received emails from in my inbox.
Now I want to do the same for my .PST archive file.
My Current code is.
how do I set the folder to my .pst file
.PST Folder name is
2010/Inbox
Any advise would be appreciated.
Now I want to do the same for my .PST archive file.
My Current code is.
Rich (BB code):
Sub GetFromInbox()
Application.ScreenUpdating = False
Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As MailItem
Dim i As Integer
Dim x As Integer
Dim y As Integer
Dim internalcount As Integer
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
Set Fldr = Fldr.Folders("2011").Folders("inbox")
UserForm1.Show False
i = 1
x = 1
Sheets("New").Cells.ClearContents
y = Fldr.Items.Count
For Each olMail In Fldr.Items
UserForm1.TextBox1.Value = x & " // " & y
UserForm1.Repaint
Sheets("New").Cells(i, 1).Value = olMail.SenderName
Sheets("New").Cells(i, 2).Value = olMail.SenderEmailAddress
i = i + 1
x = x + 1
On Error Resume Next
Next olMail
UserForm1.Hide
Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing
End Sub
how do I set the folder to my .pst file
.PST Folder name is
2010/Inbox
Any advise would be appreciated.