Adding/Deleting Contacts in Public Folders 
Author Message
 Adding/Deleting Contacts in Public Folders

UNCLE!
I give up, I bought a book as suggested by Sue Mosher in my last posting,
and I still can not get it.

From MS Access, I need to be able to delete and add contacts to a folder
named "NPC" which is in the "All Public Folders" of the "Public Folders".

I have only been successful in writing the code to add a contact to your
"Contact" folder, nothing more.  I'm afraid I am have to admit defeat on
this one and would very much appreciate any one helping me with the code for
this.

Thanks so much,  Todd

Here is the code that helped me to add a new Contact to the "Contact"
folder:

Sub AddContactToOutlook()

    Dim appOutLook As Outlook.Application
    Dim conOutLook As Outlook.ContactItem

    Set appOutLook = CreateObject("Outlook.Application")
    Set conOutLook = appOutLook.CreateItem(olContactItem)

    With conOutLook
        .FirstName = "Calvin"
        .LastName = "Smith"
        .BusinessTelephoneNumber = "(808)555-5555"

        .Birthday = "12/31/1970"
        .CompanyName = "Software Contracts-R-Us"
        .JobTitle = "Software Engineer"
        .ManagerName = "Bill Gates"
        .Save
    End With

    Set conOutLook = Nothing
    Set appOutLook = Nothing

End Sub



Fri, 18 Apr 2003 20:46:00 GMT  
 Adding/Deleting Contacts in Public Folders

Hi Todd,

The CreateItem method will always create the item in the default message
store.  What you need to do is get a MAPIFolder reference to your public
folder.  Once you have this, use Items.Add to do the work.

example...

'assuming that olPFNPC holds a reference to the public folder
Set olContact = olPFNPC.Items.Add (olContactItem)

UNCLE!
I give up, I bought a book as suggested by Sue Mosher in my last posting,
and I still can not get it.

From MS Access, I need to be able to delete and add contacts to a folder
named "NPC" which is in the "All Public Folders" of the "Public Folders".

I have only been successful in writing the code to add a contact to your
"Contact" folder, nothing more.  I'm afraid I am have to admit defeat on
this one and would very much appreciate any one helping me with the code for
this.

Thanks so much,  Todd

Here is the code that helped me to add a new Contact to the "Contact"
folder:

Sub AddContactToOutlook()

    Dim appOutLook As Outlook.Application
    Dim conOutLook As Outlook.ContactItem

    Set appOutLook = CreateObject("Outlook.Application")
    Set conOutLook = appOutLook.CreateItem(olContactItem)

    With conOutLook
        .FirstName = "Calvin"
        .LastName = "Smith"
        .BusinessTelephoneNumber = "(808)555-5555"

        .Birthday = "12/31/1970"
        .CompanyName = "Software Contracts-R-Us"
        .JobTitle = "Software Engineer"
        .ManagerName = "Bill Gates"
        .Save
    End With

    Set conOutLook = Nothing
    Set appOutLook = Nothing

End Sub



Fri, 18 Apr 2003 21:04:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. Public Folder Contact folders.

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

4. Delete Contacts from "Contact " Folder Automatically

5. Add contact information to folder other than default folder

6. Resolve Contact to Public Folder

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

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

9. Create New Contact in Public Folder

10. Referring to Items in Public (Contacts) Folder

11. Synchronizing/exporting contacts into Public Folder

12. Creating Contacts in a Public Folder

 

 
Powered by phpBB® Forum Software