Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / August 2003

Tip: Looking for answers? Try searching our database.

Creating a new contacts folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kennedy - 15 Aug 2003 23:18 GMT
How do I create a new folder inside the contacts default
folder?

Once a new folder is created I can use the move method to
place it in the contacts default folder, but I just can't
seem to find an add or create method.

Simple question that I just can't seem to be able to
figure out. Making me feel pretty inadequate actually ;)
Dmitry Streblechenko - 15 Aug 2003 23:29 GMT
set ContactsFolder = Application.Session.GetDefaultFolder(olFolderContacts)
set NewFolder = ContactsFolder.Folders.Add("My newest folder")

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

> How do I create a new folder inside the contacts default
> folder?
[quoted text clipped - 5 lines]
> Simple question that I just can't seem to be able to
> figure out. Making me feel pretty inadequate actually ;)
Kennedy - 16 Aug 2003 00:26 GMT
Thanks,

unfortunately tihs must be one of those times when the VB
and C++ go their separate ways as there is no "Folders"
method within the ContactsFolder object.

ie: I can do this:
MAPIFolder pNewFolder = pFldrContact.GetFolders()
but I can't do this:
MAPIFolder pNewFolder = pFldrContact.Folders.Add

and unfortunately their is no "Add" method in the former
and the latter just doesn't exist for Folders. So I'm at a
loss once again.

Thanks for the effort though.

Someone really ought to write a c++ book.

>-----Original Message-----
>set ContactsFolder = Application.Session.GetDefaultFolder(olFolderContacts)
[quoted text clipped - 16 lines]
>
>.
Dmitry Streblechenko - 16 Aug 2003 00:42 GMT
It really doesn't make a difference whether you are using
VB/C++/Delphi/whatever - the language syntax is different, plus VB lets you
use default methods/properties implicitly. Why can't you use something like

MAPIFolder pNewFolder = pFldrContact.GetFolders()->Add("whatever",
olFolderContacts)

In the worst case look at the header file with the wraper classes created by
VC++ when you imported the type library to figure out the correct names and
parameters.

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

> Thanks,
>
[quoted text clipped - 39 lines]
> >
> >.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.