Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This was the ONLY place that I could find information that I could use to resolve the problem. So thanks once again to member TomSark and the SQL forum!..."

Geography

Where in the world do Tek-Tips members come from?

Access posted files in Outlook public folders using Excel VBA

TvH (Programmer)
7 Aug 01 7:14
Hi,

I am creating a macro in Excel 97 to open Excel files (or save them somewhere else) which are posted in the Outlook 98 Public Folders. These Excel files are NOT attachments to mails though. I can get into the Public Folder and see the items posted there, but I can't open/save them (the file is not recognized as a mailitem or postitem). Does anyone know how to do this?

Thanks.
Ted
TvH (Programmer)
7 Aug 01 7:49
Just when I got really desperate I found something to open posted files:

    Set mailApp = New Outlook.Application
    Set mailNameSpace = mailApp.GetNamespace("MAPI")
    Set mailFolder = mailNameSpace.Folders("Folders1") _
                                  .Folders("Folders2") _
                                  .Folders("Folders3") _
                                  .Folders("Folders4")
                                  .Folders("FoldersEtc")
    
    For i = 1 To mailFolder.Items.Count
        If mailFolder.Items.Item(i) = "FileName.xls" Then
            mailFolder.Items.Item(i).Display
        End If
    Next

From here on you can access the file in excel and do whatever you want with it.

TvH

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close