Populating a contact's Note field using automation with Access 
Author Message
 Populating a contact's Note field using automation with Access

I have just recently started learning automation so that I can populate the
Contacts folder in Outlook using a table in Access.  Doing this is straight
forward expect when I want to populate the Note field within a contact item.
There appears to be no Note property for a ContactItem.

Could someone please help me by explaining how to add text to the Note field
(the field that is not labeled within the contact's record).  I have tried
using the following with, of course, no luck:

Thanks very much in advance.
John

    Dim objOutlook As New Outlook.Application
    Dim colItems As Items
    Dim rsContacts As Recordset
    Dim strMessage As String
    Dim strTableName As String

    'Open the table.
    Set rsContacts = CurrentDb.OpenRecordset("tblContacts")

    'Get a reference to the Items collection of the contacts folder.
    Set colItems = objOutlook.GetNamespace("MAPI"). _
                        GetDefaultFolder(olFolderContacts).Items

        Do Until rsContacts.EOF
                With colItems.Add
                    .FullName = Nz(rsContacts!FullName)
                    .JobTitle = Nz(rsContacts!Title)
                    .CompanyName = Nz(rsContacts!Company)
                    .BusinessAddressStreet = Nz(rsContacts!Address)
                    .BusinessAddressCity = Nz(rsContacts!Cities)
                    .BusinessAddressState = Nz(rsContacts!States)
                    .BusinessAddressPostalCode = Nz(rsContacts!Zips)
                    .BusinessTelephoneNumber = Nz(rsContacts!WorkNumber)
                    .BusinessFaxNumber = Nz(rsContacts!FaxNumbers)
                    .Categories = Nz(rsContacts!Categories)
                    .Notes = Nz(rsContacts!Notes)

                    .Save
                End With
            End If
            rsContacts.MoveNext
        Loop
        rsContacts.Close



Sat, 08 Mar 2003 03:00:00 GMT  
 Populating a contact's Note field using automation with Access

Wouldn't be talking about the .Body property would you?

Steve

Quote:

> I have just recently started learning automation so that I can populate the
> Contacts folder in Outlook using a table in Access.  Doing this is straight
> forward expect when I want to populate the Note field within a contact item.
> There appears to be no Note property for a ContactItem.

> Could someone please help me by explaining how to add text to the Note field
> (the field that is not labeled within the contact's record).  I have tried
> using the following with, of course, no luck:

> Thanks very much in advance.
> John

>     Dim objOutlook As New Outlook.Application
>     Dim colItems As Items
>     Dim rsContacts As Recordset
>     Dim strMessage As String
>     Dim strTableName As String

>     'Open the table.
>     Set rsContacts = CurrentDb.OpenRecordset("tblContacts")

>     'Get a reference to the Items collection of the contacts folder.
>     Set colItems = objOutlook.GetNamespace("MAPI"). _
>                         GetDefaultFolder(olFolderContacts).Items

>         Do Until rsContacts.EOF
>                 With colItems.Add
>                     .FullName = Nz(rsContacts!FullName)
>                     .JobTitle = Nz(rsContacts!Title)
>                     .CompanyName = Nz(rsContacts!Company)
>                     .BusinessAddressStreet = Nz(rsContacts!Address)
>                     .BusinessAddressCity = Nz(rsContacts!Cities)
>                     .BusinessAddressState = Nz(rsContacts!States)
>                     .BusinessAddressPostalCode = Nz(rsContacts!Zips)
>                     .BusinessTelephoneNumber = Nz(rsContacts!WorkNumber)
>                     .BusinessFaxNumber = Nz(rsContacts!FaxNumbers)
>                     .Categories = Nz(rsContacts!Categories)
>                     .Notes = Nz(rsContacts!Notes)

>                     .Save
>                 End With
>             End If
>             rsContacts.MoveNext
>         Loop
>         rsContacts.Close



Sat, 08 Mar 2003 03:00:00 GMT  
 Populating a contact's Note field using automation with Access
Yes!  Thank you very much, Steve.

John

Wouldn't be talking about the .Body property would you?

Steve


Quote:
> I have just recently started learning automation so that I can populate
the
> Contacts folder in Outlook using a table in Access.  Doing this is
straight
> forward expect when I want to populate the Note field within a contact
item.
> There appears to be no Note property for a ContactItem.

> Could someone please help me by explaining how to add text to the Note
field
> (the field that is not labeled within the contact's record).  I have tried
> using the following with, of course, no luck:

> Thanks very much in advance.
> John

>     Dim objOutlook As New Outlook.Application
>     Dim colItems As Items
>     Dim rsContacts As Recordset
>     Dim strMessage As String
>     Dim strTableName As String

>     'Open the table.
>     Set rsContacts = CurrentDb.OpenRecordset("tblContacts")

>     'Get a reference to the Items collection of the contacts folder.
>     Set colItems = objOutlook.GetNamespace("MAPI"). _
>                         GetDefaultFolder(olFolderContacts).Items

>         Do Until rsContacts.EOF
>                 With colItems.Add
>                     .FullName = Nz(rsContacts!FullName)
>                     .JobTitle = Nz(rsContacts!Title)
>                     .CompanyName = Nz(rsContacts!Company)
>                     .BusinessAddressStreet = Nz(rsContacts!Address)
>                     .BusinessAddressCity = Nz(rsContacts!Cities)
>                     .BusinessAddressState = Nz(rsContacts!States)
>                     .BusinessAddressPostalCode = Nz(rsContacts!Zips)
>                     .BusinessTelephoneNumber = Nz(rsContacts!WorkNumber)
>                     .BusinessFaxNumber = Nz(rsContacts!FaxNumbers)
>                     .Categories = Nz(rsContacts!Categories)
>                     .Notes = Nz(rsContacts!Notes)

>                     .Save
>                 End With
>             End If
>             rsContacts.MoveNext
>         Loop
>         rsContacts.Close



Sun, 09 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Inserting current date into a contact's note field

2. Using MS Access to populate fields in Project - UPDATE

3. Using MS Access to populate specific fields in MS Project

4. Populating existing Contact Spouse field from CSV file

5. Can't get recordset to populate datagrid using Access

6. Accessing contact notes in OL2K

7. Insert column/field using Access Automation - how??

8. Contact, Activities, Actions, Link, File using Automation

9. Using Access's boolean field

10. Databound combo boxes don't populate text field after Find

11. accessing notes field through object call

12. Importing the Notes field from Access

 

 
Powered by phpBB® Forum Software