Solved

Outlook 2010 Public Folder VBA

Posted on 2014-10-30
8
312 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
ID: 40413394
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
ID: 40413465
Its in the shared folder Conference Line
0
 
LVL 5

Expert Comment

by:ReneD100
ID: 40413562
Conference Line or  Conference Call?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:shieldsco
ID: 40413704
Its conference Line and I did change it
0
 
LVL 5

Expert Comment

by:ReneD100
ID: 40413752
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
ID: 40414868
Is the target folder (i.e. Conference Line) a top level public folder or is it under another folder?
0
 

Author Comment

by:shieldsco
ID: 40415471
under another folder
0
 
LVL 5

Accepted Solution

by:
ReneD100 earned 500 total points
ID: 40415477
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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