It doesn't look like spFolder is initialized.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Sorry for the mess, below are the testing codes
CComPtr<Outlook::_Folders> spFolder;
CComPtr<Outlook::_NameSpace> spNameSpace;
CComPtr<Outlook::MAPIFolder> spAddedFolder;
BSTR nameSpaceType = T2W("MAPI");
//m_spApp is a CComPtr<Outlook::_Application> that initialize somewhere
m_spApp->GetNamespace(nameSpaceType,&spNameSpace);
spNameSpace->get_Folders(&spFolder);
spFolder->Add(_bstr_t("TESTAGAIN"), _variant_t((long)olFolderInbox),
&spAddedFolder);
//why is it that the TESTAGAIN folder is not added
//are there any rules apply by Outlook itself on
//creating a new folder under root?
thank you.
> It doesn't look like spFolder is initialized.
>
[quoted text clipped - 49 lines]
> >
> > thanks in advance.
Dmitry Streblechenko \(MVP\) - 19 May 2004 06:16 GMT
Namespace.Folders is not a real folder, but rather a collection of all top
level folders from all message stores in the current session.
To add a new PST store to the current profile, use Namespace.AddStore()
passing a fully qualified path to the PST file.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
> Sorry for the mess, below are the testing codes
>
[quoted text clipped - 72 lines]
> > >
> > > thanks in advance.
Anthony Yio - 19 May 2004 06:59 GMT
thanks for the prompt reply.
> Namespace.Folders is not a real folder, but rather a collection of all top
> level folders from all message stores in the current session.
[quoted text clipped - 85 lines]
> > > >
> > > > thanks in advance.