PC Review


Reply
Thread Tools Rate Thread

How to create a folder in a C++ add-in ?

 
 
Paul Keogh
Guest
Posts: n/a
 
      16th Sep 2003
I've tried

spApplication -> CreateObject ("Outlook.MAPIFolder", &spFolder);

but it does'nt work.

I guess "Outlook.MAPIFolder" is the wrong object name - any suggestions ?


 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      16th Sep 2003
MAPIFolder.Folders.Add will create a child subfolder of MAPIFolder.
MAPIFolder can come either from Namespace.Folders collection or from
Namespace.GetDefaultFolder().

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


"Paul Keogh" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I've tried
>
> spApplication -> CreateObject ("Outlook.MAPIFolder", &spFolder);
>
> but it does'nt work.
>
> I guess "Outlook.MAPIFolder" is the wrong object name - any suggestions ?
>
>



 
Reply With Quote
 
Paul Keogh
Guest
Posts: n/a
 
      17th Sep 2003

"Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> MAPIFolder.Folders.Add will create a child subfolder of MAPIFolder.
> MAPIFolder can come either from Namespace.Folders collection or from
> Namespace.GetDefaultFolder().
>


Hi,

Thanks for your answer. Here is the method I invoke for the Add() as you
describe above;


[id(0x0000005f), helpcontext(0x004debcc)]
HRESULT Add([in] BSTR Name, [in, optional] VARIANT Type, [out, retval]
MAPIFolder** Folder);

But;
* What should Name be ? Just the name of the new folder ("mynewfolder") or
the full path ("Inbox\mynewfolder") ?
* What are the range of values for Type ?
* Where can I find documentation on the arguments to methods in the Outlook
type library ?

Thanks,
Paul.


 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      17th Sep 2003
1. Just the name ("mynewfolder")

2. From the help file:
expression.Add(Name, Type)
expression Required. An expression that returns a Folders object.
Name Required String. The display name for the new folder.
Type Optional Long. The Outlook folder type for the new folder. If the
folder type is not specified, the new folder will default to the same type
as the folder in which it is created. Can be one of the following
OlDefaultFolders constants: olFolderCalendar, olFolderContacts,
olFolderDrafts, olFolderInbox, olFolderJournal, olFolderNotes, or
olFolderTasks. (The constants olFolderDeletedItems, olFolderOutbox, and
olFolderSentMail cannot be specified for this argument.)

3. See VBAOL10.CHM help file - Make sure you install VBA files when
installing Ooffice. Also see http://www.slipstick.com - it will be much more
helpful than the VBA help file.

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


"Paul Keogh" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> "Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > MAPIFolder.Folders.Add will create a child subfolder of MAPIFolder.
> > MAPIFolder can come either from Namespace.Folders collection or from
> > Namespace.GetDefaultFolder().
> >

>
> Hi,
>
> Thanks for your answer. Here is the method I invoke for the Add() as you
> describe above;
>
>
> [id(0x0000005f), helpcontext(0x004debcc)]
> HRESULT Add([in] BSTR Name, [in, optional] VARIANT Type, [out, retval]
> MAPIFolder** Folder);
>
> But;
> * What should Name be ? Just the name of the new folder ("mynewfolder") or
> the full path ("Inbox\mynewfolder") ?
> * What are the range of values for Type ?
> * Where can I find documentation on the arguments to methods in the

Outlook
> type library ?
>
> Thanks,
> Paul.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solution to: Can't create file:.xls. Right click folder you want to create the file in and then click properties on the shortcut menu to check your permissions on this folder Ky_fanatic Microsoft Outlook Discussion 1 8th Dec 2006 06:15 PM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k Microsoft Excel Programming 6 11th Aug 2006 08:41 PM
When I try to open/save .rtf attachment I get the messages ?Can't create file. Right-click the folder you want to create item in and then click on the shortcut menu to check your permissions for the folder.? Nie Geweune via AdminLife Microsoft Outlook Installation 2 28th Jun 2006 05:07 PM
Create a search folder to look at all emails in one folder and selected criteria in other folders phil.whitacre@cox.net Microsoft Outlook 1 10th Apr 2006 09:40 AM
Unable to create the folder,'New Folder'.The drive cannot find the sector requested. =?Utf-8?B?aG9tZWUyMDEw?= Windows XP Help 3 2nd Jan 2004 10:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 PM.