ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Outlook from Excel (https://www.excelbanter.com/excel-programming/295888-outlook-excel.html)

scottnshelly[_20_]

Outlook from Excel
 
I remember seeing the code for this before, but i can't seem to find it
any suggestions would be great.
I need to pull all emails that contain a certain word or from a certai
folder and put them onto a spreadsheet.
should be pretty simple for you smart guys, but i have no idea where t
begin.
thanks

--
Message posted from http://www.ExcelForum.com


Steven

Outlook from Excel
 
http://www.rondebruin.nl/



Dick Kusleika[_3_]

Outlook from Excel
 
Scott

http://www.dicks-clicks.com/excel/olRetrieving.htm

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"scottnshelly " wrote in
message ...
I remember seeing the code for this before, but i can't seem to find it.
any suggestions would be great.
I need to pull all emails that contain a certain word or from a certain
folder and put them onto a spreadsheet.
should be pretty simple for you smart guys, but i have no idea where to
begin.
thanks.


---
Message posted from http://www.ExcelForum.com/




scottnshelly[_23_]

Outlook from Excel
 
Is it possible to retrieve all e-mails from a folder rather than al
e-mails that contain a word

--
Message posted from http://www.ExcelForum.com


Jake Marx[_3_]

Outlook from Excel
 
Hi Scott,

Is it possible to retrieve all e-mails from a folder rather than all
e-mails that contain a word?


Yes. Here's some modified code that list the subject, from name, and
received time of all emails in a folder named "test":

Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Outlook.MailItem
Dim i As Integer

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox).Folders("test ")

For Each olMail In Fldr.Items
i = i + 1
ActiveSheet.Cells(i, 1).Value = olMail.Subject
ActiveSheet.Cells(i, 2).Value = olMail.SenderName
ActiveSheet.Cells(i, 3).Value = olMail.ReceivedTime
Next olMail

Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


scottnshelly[_53_]

Outlook from Excel
 
Thanks,
Now i have this code that pulls all the e-mails from a folder name
'terms' and puts them into different cells in the same column the
prints. the problem is, i only need one four-digit number from eac
cell. so i end up printing way too many pages than neccessary. is i
possible to only print the four-digit number from each e-mail/cell?
Thanks

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com