How to strip names from Outlook ? Please help.

RompStar

Well-known Member
Joined
Mar 25, 2005
Messages
1,200
Ok, Microsoft Outlook (not express), when I open it, and click on my Inbox, I see a list of the individual emais in that folder.

Let's say that day there are over 400 emails, I want to figure out a way to look into the INBOX and look into each email and strip the First and Last name of the sender (don't care about their email address) and then put that into an Excel Sheet, with two columns for first and last name.

I did almost the opposite before, I had a Macro look into the column M I think it was of an excel sheet, strip the emails and format an email and then send it via outlook, that works, what about the other way around ?

Please let me know.

How can one do this ? :unsure:

:confused:
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
A received email does not have first name or last name information. It just has sender's name. This is a string which could contain the sender's first and last name or just the email address. It depends on how the sender has set it up. That said:

Somthing like this should work. You have to add a reference to the Microsoft Outlook object library and change the address in the set statement for the "rng" range to be the address of the cell to hold the first name:

Dim myolApp, mlItem As mailitem, InBox As MAPIFolder, rng As Range
Set myolApp = CreateObject("Outlook.Application")
Set InBox = myolApp.GetNamespace("MAPI").Folders("personal folders").Folders("inbox")
Set rng = Worksheets("sheet1").Range("a1")
For Each mlItem In InBox.Items
rng = mlItem.SenderName
Set rng = rng.Offset(1, 0)
Next
 
Upvote 0
Thanks for the tips, I think I can manager from here :- )

Thanks for your time and happy new year, maybe human
stupidy will end in 2005, hahahaha.

:LOL:
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top