Create New Contact in Public Folder 
Author Message
 Create New Contact in Public Folder

I am currently trying to have my Access database run code
to create a Contact Item in a Public Folder (Address Book)
so that all my users can access this information. What is
happening is that the contact item is being created in my
Contacts address book, not the Advisor Contacts address
book. I have attached the code. Can anyone tell me where
I'm going wrong?

Thanks!

Melissa Lamprecht

Code Follows:

Dim ol As New Outlook.Application
    Dim olns As Outlook.NameSpace
    Dim cf As Outlook.MAPIFolder
    Dim cf1 As Outlook.MAPIFolder
    Dim cf2 As Outlook.MAPIFolder
    Dim c As Outlook.ContactItem
    Dim Prop As Outlook.UserProperty

    Set olns = ol.GetNamespace("MAPI")
    Set cf1 = olns.Folders("Public Folders")
    Set cf2 = cf1.Folders("All Public Folders")
    Set cf = cf2.Folders("Advisor Contacts")

    Set c = ol.CreateItem(olContactItem)
    c.MessageClass = "IPM.Contact.AdvisorContacts" 'Custom
Form Showing Customer ID

    c.CompanyName = firm
    c.FullName = advfirst & " " & advlast
    c.BusinessAddressStreet = addr1
    c.BusinessAddressCity = cty
    c.BusinessAddressState = st
    c.BusinessAddressPostalCode = zp
    c.BusinessTelephoneNumber = ph
    c.Email1Address = eml
    c.Email1AddressType = "SMTP"
    c.Email1DisplayName = display
    c.CustomerID = alias

    c.Save
    c.Close olSave



Wed, 23 Nov 2005 00:15:00 GMT  
 Create New Contact in Public Folder
I found another post with the answer I needed. Thanks
anyway!
Quote:
>-----Original Message-----
>I am currently trying to have my Access database run code
>to create a Contact Item in a Public Folder (Address
Book)
>so that all my users can access this information. What is
>happening is that the contact item is being created in my
>Contacts address book, not the Advisor Contacts address
>book. I have attached the code. Can anyone tell me where
>I'm going wrong?

>Thanks!

>Melissa Lamprecht

>Code Follows:

>Dim ol As New Outlook.Application
>    Dim olns As Outlook.NameSpace
>    Dim cf As Outlook.MAPIFolder
>    Dim cf1 As Outlook.MAPIFolder
>    Dim cf2 As Outlook.MAPIFolder
>    Dim c As Outlook.ContactItem
>    Dim Prop As Outlook.UserProperty

>    Set olns = ol.GetNamespace("MAPI")
>    Set cf1 = olns.Folders("Public Folders")
>    Set cf2 = cf1.Folders("All Public Folders")
>    Set cf = cf2.Folders("Advisor Contacts")

>    Set c = ol.CreateItem(olContactItem)
>    c.MessageClass

= "IPM.Contact.AdvisorContacts" 'Custom

- Show quoted text -

Quote:
>Form Showing Customer ID

>    c.CompanyName = firm
>    c.FullName = advfirst & " " & advlast
>    c.BusinessAddressStreet = addr1
>    c.BusinessAddressCity = cty
>    c.BusinessAddressState = st
>    c.BusinessAddressPostalCode = zp
>    c.BusinessTelephoneNumber = ph
>    c.Email1Address = eml
>    c.Email1AddressType = "SMTP"
>    c.Email1DisplayName = display
>    c.CustomerID = alias

>    c.Save
>    c.Close olSave
>.



Wed, 23 Nov 2005 00:24:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating Contacts in a Public Folder

2. How to create a contact in a Public Folder with VBA

3. HELP!!! Creating Contacts on Public Folders

4. Public Folder Contact folders.

5. Syncronize in programmatic way, the folder Contact with the public folder

6. create a new contact folder

7. How to create new contacts folder

8. How do I add a contact to a public folder programatically

9. Resolve Contact to Public Folder

10. Need sample code for read public folder contact into access

11. Enable a Public folder (contacts) for Outlook address Book

12. Referring to Items in Public (Contacts) Folder

 

 
Powered by phpBB® Forum Software