Extract email to excel from a specific sender

Status
Not open for further replies.

Kartyk

Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Hi,
Looking to extract email from outlook from a specific sender.

Can anyone please suggest modification to the code pls.

Dim olApp As Outlook.Application
Dim objNS As Outlook.Namespace
Set olApp = Outlook.Application
Set objNS = olApp.GetNamespace("MAPI")
Set myolItems = objNS.GetDefaultFolder(olFolderInbox).Items

For i = 1 To myolItems.Count
Set myitem = myolItems(i)
msgtext = myitem.Body

Range("c" & i + 6).Value = myitem.ReceivedTime
Range("d" & i + 6).Value = myitem.SenderName
Range("e" & i + 6).Value = myitem.Subject
Range("f" & i + 6).Value = myitem.Categories

Next
 

Kartyk

Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Thanks for your response. However, code picks all emails if condition doesnt seem to work ...
Not sure if am missing something here
 

Kartyk

Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Its working now. However, there is a concern. Although, emails dont get pulled up in the spreadsheet, empty rows can be seen, This is cuz I is defined prior to If condiition. Is there a way to only list emails from the ID and avoid all empty rows ?

Thanks
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Extract all links from Outlook email, send to Excel Using Outlook 2
O VBA to extract email (fields and body) to Excel Outlook VBA and Custom Forms 14
K Extract email address from body and auto-reply outlook Using Outlook 1
B Extract Dates for Appointment Item in Body of email Outlook VBA and Custom Forms 10
K extract certain text from an Outlook Email Message Outlook VBA and Custom Forms 2
H Extract emails from Outlokk 2007 email body Using Outlook 0
E I am trying to extract the email adress's i have in outlook. These are not saved 'contacts' these are ones from auto fill. When i open up an email, an Using Outlook 1
R Saving Outlook Email As Text File Extract Outlook VBA and Custom Forms 2
I How to extract email addresses from TO or CC line of a particular email Outlook VBA and Custom Forms 2
C Macro to extract sender name & subject line of incoming emails to single txt file Outlook VBA and Custom Forms 3
N Extract Outlook emails to excel Outlook VBA and Custom Forms 2
T Extract Data From Outlook Tasks Using Outlook 0
T Extract Data From Outlook Tasks Using Outlook 0
V extract users of a particular department Outlook VBA and Custom Forms 1
J Outlook 2013 Extract Flag Completed dates to Excel Macro Outlook VBA and Custom Forms 16
S How to extract mail items from multiple folders and shared mailboxes? Outlook VBA and Custom Forms 0
R Trying to extract information between two symbols from outlook subject Using Outlook 2
P Recover / Extract Rules from standalone PST file creating RWZ file Using Outlook 2
D Need to extract a line from a word attachment, and add it to the subject line Outlook VBA and Custom Forms 3
E Extract excel files from outlook Outlook VBA and Custom Forms 2
D VBA Script to extract text matching specific criteria Outlook VBA and Custom Forms 1
M Extract text in existing message body for use in newmail items Using Outlook 17
M HELP--Extract Data from 2003 outlook transfer to excel spreadsheet Using Outlook 1
M VBA Code to extract data from an Outlook Form Using Outlook 0
M Extract attachments with a script Using Outlook 0
M HELP - Can't open outlook... How can I extract my Emails that I had in folders Using Outlook 3
K Extract Global Address List Using Outlook 1
L How to extract table format of Task Item if its body contains formatted table. Exchange Server Administration 1
N Programming to extract automatically extract attachments Outlook VBA and Custom Forms 3
S How to extract outlook calendar data. Outlook VBA and Custom Forms 3
? outlook attachment Extract File ??? Outlook VBA and Custom Forms 1
D Extract Data from OST File Using Outlook 2
N How to extract date and time stamp from messsages Outlook VBA and Custom Forms 6
V Extract Subject,Sent From, Message from mailbox to Excel Outlook VBA and Custom Forms 5
S Automatically extract attachments? Outlook VBA and Custom Forms 1
W Reply to email Using Outlook 0
F Junk Email does not get added to the Blocked Sender List Using Outlook 0
B disappearing original when attach to email Using Outlook 1
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
glnz O365 - How to combine the Inboxes for four email accounts into a single Inbox Using Outlook 7
glnz O365 - How to send from acct 2 but showing email name from acct 1 as From - alias? Using Outlook 1
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
E Asking user to select multiple options in a list in an email Outlook VBA and Custom Forms 0
K Use VBA to find Sender and Recipient from Microsfot 365 Journaled Email Items Outlook VBA and Custom Forms 3
B Add ComboBox Value to Body of Email Outlook VBA and Custom Forms 1
A Backup Email Accounts On OutLook For Mac 2016 (Microsoft 365 subscription version) Using Outlook 0
F VBA code to dock Styles whenever I write or edit an email Outlook VBA and Custom Forms 0
G Inbox shows old email Using Outlook 3
L Email with correct To address but displaying name of a related person Using Outlook 0

Similar threads

Top