Access Denied When Creating Hidden Folder

R

Ryan Hubbard

I used the following code given to be me from Ken.
It works fine on one computer using Outlook 2003 No Exchange. I tried
using it on another computer with Outlook 2003 with Exchange and I get
the following error: [Collaberation Data Objects -
[E_ACCESSDENIED(80070005)]]

Any reason why? And how do I solve it. Thanks

Const CdoPR_FINDER_ENTRYID = &H35E70102

Dim objSession As New MAPI.Session
Dim objInfostore As MAPI.InfoStore
Dim objFinderFolder As MAPI.Folder
Dim objRootFolder As MAPI.Folder
Dim objFolders As MAPI.Folders
Dim objFolder As MAPI.Folder
Dim strFinderEntryID As String

objSession.Logon "", "", False, False
Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID =
objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID,
objInfostore.ID)
Set objRootFolder = objSession.GetFolder(objFinderFolder.FolderID,
objInfostore.ID)
Set objFolders = objRootFolder.Folders
Set objFolder = objFolders.Add("Foobar")
 
D

Dmitry Streblechenko \(MVP\)

Can you create the same folder using Outlook UI? Did you make sure there is
no folder with the same name already?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
R

Ryan Hubbard

Yes I iterated through the folders to see if there was a folder with the
same name but there was not. How can I create it using the Outlook UI?

Can you create the same folder using Outlook UI? Did you >make sure there is
no folder with the same name already?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
I used the following code given to be me from Ken.
It works fine on one computer using Outlook 2003 No Exchange. I tried
using it on another computer with Outlook 2003 with Exchange and I get
the following error: [Collaberation Data Objects -
[E_ACCESSDENIED(80070005)]]

Any reason why? And how do I solve it. Thanks

Const CdoPR_FINDER_ENTRYID = &H35E70102

Dim objSession As New MAPI.Session
Dim objInfostore As MAPI.InfoStore
Dim objFinderFolder As MAPI.Folder
Dim objRootFolder As MAPI.Folder
Dim objFolders As MAPI.Folders
Dim objFolder As MAPI.Folder
Dim strFinderEntryID As String

objSession.Logon "", "", False, False
Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID =
objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID,
objInfostore.ID)
Set objRootFolder = objSession.GetFolder(objFinderFolder.FolderID,
objInfostore.ID)
Set objFolders = objRootFolder.Folders
Set objFolder = objFolders.Add("Foobar")
 
D

Dmitry Streblechenko \(MVP\)

Wait a sec, you ae trying to add a child folder to the finder (search) root
folder. You cannot do that, that folder only has search folders as its
children. You can create new subfolders there only using Extended MAPI.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
Yes I iterated through the folders to see if there was a folder with the
same name but there was not. How can I create it using the Outlook UI?

Can you create the same folder using Outlook UI? Did you >make sure there is
no folder with the same name already?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
I used the following code given to be me from Ken.
It works fine on one computer using Outlook 2003 No Exchange. I tried
using it on another computer with Outlook 2003 with Exchange and I get
the following error: [Collaberation Data Objects -
[E_ACCESSDENIED(80070005)]]

Any reason why? And how do I solve it. Thanks

Const CdoPR_FINDER_ENTRYID = &H35E70102

Dim objSession As New MAPI.Session
Dim objInfostore As MAPI.InfoStore
Dim objFinderFolder As MAPI.Folder
Dim objRootFolder As MAPI.Folder
Dim objFolders As MAPI.Folders
Dim objFolder As MAPI.Folder
Dim strFinderEntryID As String

objSession.Logon "", "", False, False
Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID =
objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID,
objInfostore.ID)
Set objRootFolder = objSession.GetFolder(objFinderFolder.FolderID,
objInfostore.ID)
Set objFolders = objRootFolder.Folders
Set objFolder = objFolders.Add("Foobar")
 
R

Ryan Hubbard

I'm not sure about the finder (search) root folder, but I think it is
the root folder. If I can't do it with CDO then why I can I do it on
a non exchange Outlook mailbox? I have noticed that the folders
collection is different between the two outlook setups. Where can I
create a hidden folder for outlook with exchange?


Dmitry Streblechenko \(MVP\) said:
Wait a sec, you ae trying to add a child folder to the finder (search) root
folder. You cannot do that, that folder only has search folders as its
children. You can create new subfolders there only using Extended MAPI.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
Yes I iterated through the folders to see if there was a folder with the
same name but there was not. How can I create it using the Outlook UI?

Can you create the same folder using Outlook UI? Did you >make sure there is
no folder with the same name already?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
I used the following code given to be me from Ken.
It works fine on one computer using Outlook 2003 No Exchange. I tried
using it on another computer with Outlook 2003 with Exchange and I get
the following error: [Collaberation Data Objects -
[E_ACCESSDENIED(80070005)]]

Any reason why? And how do I solve it. Thanks

Const CdoPR_FINDER_ENTRYID = &H35E70102

Dim objSession As New MAPI.Session
Dim objInfostore As MAPI.InfoStore
Dim objFinderFolder As MAPI.Folder
Dim objRootFolder As MAPI.Folder
Dim objFolders As MAPI.Folders
Dim objFolder As MAPI.Folder
Dim strFinderEntryID As String

objSession.Logon "", "", False, False
Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID =
objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID,
objInfostore.ID)
Set objRootFolder = objSession.GetFolder(objFinderFolder.FolderID,
objInfostore.ID)
Set objFolders = objRootFolder.Folders
Set objFolder = objFolders.Add("Foobar")
 
D

Dmitry Streblechenko \(MVP\)

I mean the *search* root folder (look at it using MdbView or OutlookSpy).
AFAIK PST provider allows to create regular and search folders on any level
as long as you do not create child folders in a search folder.
Exchange provider only allows search folders as children of the root search
folder

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
I'm not sure about the finder (search) root folder, but I think it is
the root folder. If I can't do it with CDO then why I can I do it on
a non exchange Outlook mailbox? I have noticed that the folders
collection is different between the two outlook setups. Where can I
create a hidden folder for outlook with exchange?


"Dmitry Streblechenko \(MVP\)" <[email protected]> wrote in message
Wait a sec, you ae trying to add a child folder to the finder (search) root
folder. You cannot do that, that folder only has search folders as its
children. You can create new subfolders there only using Extended MAPI.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
Yes I iterated through the folders to see if there was a folder with the
same name but there was not. How can I create it using the Outlook UI?


Can you create the same folder using Outlook UI? Did you >make sure there is
no folder with the same name already?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


I used the following code given to be me from Ken.
It works fine on one computer using Outlook 2003 No Exchange. I tried
using it on another computer with Outlook 2003 with Exchange and I get
the following error: [Collaberation Data Objects -
[E_ACCESSDENIED(80070005)]]

Any reason why? And how do I solve it. Thanks

Const CdoPR_FINDER_ENTRYID = &H35E70102

Dim objSession As New MAPI.Session
Dim objInfostore As MAPI.InfoStore
Dim objFinderFolder As MAPI.Folder
Dim objRootFolder As MAPI.Folder
Dim objFolders As MAPI.Folders
Dim objFolder As MAPI.Folder
Dim strFinderEntryID As String

objSession.Logon "", "", False, False
Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID =
objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID,
objInfostore.ID)
Set objRootFolder = objSession.GetFolder(objFinderFolder.FolderID,
objInfostore.ID)
Set objFolders = objRootFolder.Folders
Set objFolder = objFolders.Add("Foobar")
 
R

Ryan Hubbard

Thanks Dmitry. Is there any place I can create hidden folders with an
account setup to use exchange using CDO or am I just out of luck?

Dmitry Streblechenko \(MVP\) said:
I mean the *search* root folder (look at it using MdbView or OutlookSpy).
AFAIK PST provider allows to create regular and search folders on any level
as long as you do not create child folders in a search folder.
Exchange provider only allows search folders as children of the root search
folder

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
I'm not sure about the finder (search) root folder, but I think it is
the root folder. If I can't do it with CDO then why I can I do it on
a non exchange Outlook mailbox? I have noticed that the folders
collection is different between the two outlook setups. Where can I
create a hidden folder for outlook with exchange?


"Dmitry Streblechenko \(MVP\)" <[email protected]> wrote in message
Wait a sec, you ae trying to add a child folder to the finder (search) root
folder. You cannot do that, that folder only has search folders as its
children. You can create new subfolders there only using Extended MAPI.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Yes I iterated through the folders to see if there was a folder with the
same name but there was not. How can I create it using the Outlook UI?


Can you create the same folder using Outlook UI? Did you >make sure there is
no folder with the same name already?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


I used the following code given to be me from Ken.
It works fine on one computer using Outlook 2003 No Exchange. I tried
using it on another computer with Outlook 2003 with Exchange and I get
the following error: [Collaberation Data Objects -
[E_ACCESSDENIED(80070005)]]

Any reason why? And how do I solve it. Thanks

Const CdoPR_FINDER_ENTRYID = &H35E70102

Dim objSession As New MAPI.Session
Dim objInfostore As MAPI.InfoStore
Dim objFinderFolder As MAPI.Folder
Dim objRootFolder As MAPI.Folder
Dim objFolders As MAPI.Folders
Dim objFolder As MAPI.Folder
Dim strFinderEntryID As String

objSession.Logon "", "", False, False
Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID =
objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID,
objInfostore.ID)
Set objRootFolder = objSession.GetFolder(objFinderFolder.FolderID,
objInfostore.ID)
Set objFolders = objRootFolder.Folders
Set objFolder = objFolders.Add("Foobar")
 
D

Dmitry Streblechenko \(MVP\)

Yes, regular non-IPM folders should be fine, as long as you don't create
them in the finder root. Try to retrieve the entry id of the objFinderFolder
parent folder (using objFinderFolder.Fields(PR_PARENT_ENTRYID), where
PR_PARENT_ENTRYID = 0x0E090102), open that folder and create a subfolder
there.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
Thanks Dmitry. Is there any place I can create hidden folders with an
account setup to use exchange using CDO or am I just out of luck?

"Dmitry Streblechenko \(MVP\)" <[email protected]> wrote in message
I mean the *search* root folder (look at it using MdbView or OutlookSpy).
AFAIK PST provider allows to create regular and search folders on any level
as long as you do not create child folders in a search folder.
Exchange provider only allows search folders as children of the root search
folder

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Ryan Hubbard said:
I'm not sure about the finder (search) root folder, but I think it is
the root folder. If I can't do it with CDO then why I can I do it on
a non exchange Outlook mailbox? I have noticed that the folders
collection is different between the two outlook setups. Where can I
create a hidden folder for outlook with exchange?


"Dmitry Streblechenko \(MVP\)" <[email protected]> wrote in message
Wait a sec, you ae trying to add a child folder to the finder
(search)
root
folder. You cannot do that, that folder only has search folders as its
children. You can create new subfolders there only using Extended MAPI.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Yes I iterated through the folders to see if there was a folder
with
the
same name but there was not. How can I create it using the
Outlook
UI?
Can you create the same folder using Outlook UI? Did you >make
sure
there is
no folder with the same name already?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


I used the following code given to be me from Ken.
It works fine on one computer using Outlook 2003 No Exchange. I tried
using it on another computer with Outlook 2003 with Exchange and
I
get
the following error: [Collaberation Data Objects -
[E_ACCESSDENIED(80070005)]]

Any reason why? And how do I solve it. Thanks

Const CdoPR_FINDER_ENTRYID = &H35E70102

Dim objSession As New MAPI.Session
Dim objInfostore As MAPI.InfoStore
Dim objFinderFolder As MAPI.Folder
Dim objRootFolder As MAPI.Folder
Dim objFolders As MAPI.Folders
Dim objFolder As MAPI.Folder
Dim strFinderEntryID As String

objSession.Logon "", "", False, False
Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID =
objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID,
objInfostore.ID)
Set objRootFolder = objSession.GetFolder(objFinderFolder.FolderID,
objInfostore.ID)
Set objFolders = objRootFolder.Folders
Set objFolder = objFolders.Add("Foobar")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top