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:
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

cpod

Board Regular
Joined
Apr 2, 2002
Messages
124
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
 

RompStar

Well-known Member
Joined
Mar 25, 2005
Messages
1,200
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:
 

Watch MrExcel Video

Forum statistics

Threads
1,118,381
Messages
5,571,804
Members
412,420
Latest member
Quintankerus
Top