Solved

Outlook 2010 Public Folder VBA

Posted on 2014-10-30
8
297 Views
Last Modified: 2014-11-26
I'm trying to open a  calendar in a public folder using the code below, however I get an error message:
runtime error: 2147221233 (8004010f) The attempted operation failed. An object could not be found

 Set olkCal = Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Conference Call")

Any Thoughts
0
Comment
Question by:shieldsco
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:ReneD100
Comment Utility
Maybe a typo in the name?
Try to list all the folder names
    Dim olkPub, olkcal As Outlook.Folder
    Set olkPub = Session.GetDefaultFolder(olPublicFoldersAllPublicFolders)
    Dim i As Integer
    For i = 1 To olkPub.Folders.Count
        Set olkcal = olkPub.Folders(i)
        debug.print olkcal.Name
        'or MsgBox olkcal.Name
    Next

Open in new window

0
 

Author Comment

by:shieldsco
Comment Utility
Its in the shared folder Conference Line
0
 
LVL 5

Expert Comment

by:ReneD100
Comment Utility
Conference Line or  Conference Call?
0
 

Author Comment

by:shieldsco
Comment Utility
Its conference Line and I did change it
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:ReneD100
Comment Utility
Then it should work. You could test it by using the number. First obtain that by changing the print line to:
debug.print i, olkcal.Name

Open in new window

Then you can change your code to (3 used as an example, use the number you found of course:
Set olkCal = Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders(3) 

Open in new window


The name should also work, but let's try this first.
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
Is the target folder (i.e. Conference Line) a top level public folder or is it under another folder?
0
 

Author Comment

by:shieldsco
Comment Utility
under another folder
0
 
LVL 5

Accepted Solution

by:
ReneD100 earned 500 total points
Comment Utility
If it's under another folder you'll have to include that as well:
Set olkCal = Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("OtherFolder") .Folders("Conference Line")

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
Resolve DNS query failed errors for Exchange
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now