Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Filenames into Excel

Status
Not open for further replies.

SirLaugha1ot

Programmer
Oct 14, 2001
9
US
I'm having trouble trying to figure out how get a list of filenames from a folder in Outlook2000.

In Public Folders, I have a directory containing notepad files and I would like to be able to search for files posted on a specific date and copy only the filenames (subject?) into Excel.

I'm not sure if it's possible but figured I would ask anyway. Thanks for any help!
 
Sub sbGetSelectedItemFileNames()
Dim myItem1 As DocumentItem
Dim mySelection As Selection
Dim myOlApp0 As Object

Set myOlApp0 = CreateObject("Outlook.Application")

Set mySelection = Application.ActiveExplorer.Selection
For Each myItem1 In mySelection
MsgBox myItem1.Attachments.Item(1).FileName
'MsgBox myItem1.Subject
'MsgBox myItem1.ConversationTopic
'myItem1.UnRead = False
Next myItem1
End Sub
ide
 
Thanks ide...but since I'm still kind of learning VBA, could you breakdown the code and explain it to me? I tried to copy/paste it into Excel as a macro and run it and received an error.

Thanks again for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top