![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: adding, contacts, folder, secondary |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
If I have 2 contact folders (Contacts,Test). I want to add a DL list to Test.
If I use Set objDstList = olApp.CreateItem(olDistributionListItem) it puts it in Contacts. How do I code the object to create objDstlist in folder Test ? Thanks |
| Ads |
|
#2
|
|||
|
|||
|
Use the Add method on the target folder's Items collection, passing the message class ("IPM.DistList") as the argument.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Hal" wrote in message ... If I have 2 contact folders (Contacts,Test). I want to add a DL list to Test. If I use Set objDstList = olApp.CreateItem(olDistributionListItem) it puts it in Contacts. How do I code the object to create objDstlist in folder Test ? Thanks |
|
#3
|
|||
|
|||
|
Am Mon, 25 Sep 2006 19:33:02 -0700 schrieb Hal:
You can call the folder“s Items.Add function. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- If I have 2 contact folders (Contacts,Test). I want to add a DL list to Test. If I use Set objDstList = olApp.CreateItem(olDistributionListItem) it puts it in Contacts. How do I code the object to create objDstlist in folder Test ? Thanks |
|
#4
|
|||
|
|||
|
M
I cannt get it to work.. I know my VBA knowledge of outlook object model is weak Dim olApp As Outlook.Application Dim objDstList As Outlook.DistListItem Dim objNameSpace As Outlook.NameSpace Dim objRcpnt As Outlook.Recipient Dim objRcpnt2 As Outlook.Recipient Dim objMail As Outlook.MailItem Dim objRcpnts As Outlook.Recipients Dim objContact As Outlook.ContactItem Dim objContacts As Outlook.Items Dim ObjCategories As Outlook.Items Dim objCategory As Object Dim ObjFolder As Outlook.MAPIFolder Dim ObjMyFolder As Object Dim myfolder As Outlook.Items Dim myitem As Object Dim myitems As Outlook.Items Sub getname() Set olApp = Outlook.Application Set objNameSpace = olApp.GetNamespace("MAPI") Set ObjFolder = objNameSpace.GetDefaultFolder(olFolderContacts) ' private contacts Set ObjMyFolder = ObjFolder.Folders("test") Set myfolder = ObjMyFolder Set objDstList = myfolder.Items.Add("A1", olDistributionListItem) end *** how do I set myfolder to be pointing to the correct contacts list to add ? I want to add A1 to test *** "Michael Bauer [MVP - Outlook]" wrote: Am Mon, 25 Sep 2006 19:33:02 -0700 schrieb Hal: You can call the folder“s Items.Add function. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- If I have 2 contact folders (Contacts,Test). I want to add a DL list to Test. If I use Set objDstList = olApp.CreateItem(olDistributionListItem) it puts it in Contacts. How do I code the object to create objDstlist in folder Test ? Thanks |
|
#5
|
|||
|
|||
|
Set objDstList = myfolder.Items.Add("IPM.DistList")
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Hal" wrote in message ... M I cannt get it to work.. I know my VBA knowledge of outlook object model is weak |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Advanced - Adding a Secondary pst file without opening Outlook. | Any help would be appreciated | Outlook - Installation | 1 | August 30th 06 08:30 PM |
| Adding a shared contacts folder as an Outlook Address Boook | EJB | Outlook - Using Contacts | 7 | August 16th 06 07:59 PM |
| Adding addresses to contacts folder | PEP | Outlook - Using Contacts | 1 | July 20th 06 10:44 PM |
| Adding Subject Column to Sent Items Folder | joelhoh | Outlook - Installation | 2 | April 26th 06 03:46 PM |
| Adding Public Folder Calendar to Outlook | Jim H | Outlook - Calandaring | 1 | March 4th 06 07:46 PM |