No announcement yet.

Heatvent's Contact Sync Script (Outlook => HSP)

  • Filter
  • Time
  • Show
Clear All
new posts

    Heatvent's Contact Sync Script (Outlook => HSP)

    OK, I meant to do more with this but never got around to it but thought others might find it useful. Attached is a script that syncs the contacts in Outook on the local machine with HS phone contacts. I hope someone finds this useful. It is definitely not full featured but it gets the task done.

    FYI, I am not a programmer of any sorts. I pulled this together with web research, trial and error and a lot of luck. Please be kind. It would be great if someone with the proper skills can take this to the next level .

    Specifics are as follows:


    Contact Sync.vb - script that accesses Outlook contacts and compares to HS contacts. If the If last, first and company name in HomeSeer match the Outlook contact, then the contact is considered a match and the contact is not added. If it is not a match, the Outlook contact is added to HS contacts. The follow fields are updated:

    HSP Field Outlook Field
    business_phone <= BusinessTelephoneNumber
    business_phone_2 <= Business2TelephoneNumber
    cell_phone <= MobileTelephoneNumber
    email_address <= Email1Address
    email_address_2 <= Email2Address
    email_address_3 <= Email3Address
    home_phone <= HomeTelephoneNumber
    home_phone_2 <= Home2TelephoneNumber
    fax_home <= HomeFaxNumber
    fax_work <= BusinessFaxNumber
    pager_phone <= PagerNumber
    cid_group_category <= Categories
    business_address_1 <= BusinessAddressStreet
    business_city <= BusinessAddressCity
    business_country <= BusinessAddressCountry
    business_postal_code <= BusinessAddressPostalCode
    business_state_province <= BusinessAddressState
    home_address_1 <= HomeAddressStreet
    home_city <= HomeAddressCity
    home_country <= HomeAddressCountry
    home_postal_code <= HomeAddressPostalCode
    home_state_province <= HomeAddressState

    Also, the following HSP contact fields are given the following default values. These can easily be changed to anything you like.

    misc1 = ""
    misc2 = ""
    misc3 = ""
    misc4 = ""
    misc5 = ""
    misc6 = ""
    miscnum1 = "0"
    miscnum2 = "0"
    miscnum3 = "0"
    miscnum4 = "0"
    EnableRingPattern = "False"
    RingOn = "3"
    RingOff = "2"
    RingDelay = "10"

    Delete All Contacts In Address Book.vb - useful script to delete all your contacts in HS Phone.


    Put the two .vb scripts in ther \scripts subdirectory of you HomeSeer main directory. Put the office .dll's in the HomSeer main directory. Add the following line below [Settings] in the settings.ini file in the \config directory of you HomeSeer install:

    scriptingreferences=Microsoft.Office.Interop.Outlook;Microso ft.Office.Interop.Outlook.dll,Office;Office.dll


    As is, you can setup a couple of manually triggered events to run the above scripts. The way I use this is Outlook is the master record of my contacts. I use Plaxo to keep my other versions of Outlook sync'd with Outlook installed on my HS machine. I occassionally delete all HS contacts and reimport all Outlook contacts.

    • More intelligent comparison of data to better update contacts rather than just a full add of a contact by name. This would probably require giving some kind of ID to the Outlook contacts so they could be matched on data that would not be updated. The misc fields in HSP could be used for this.
    • Two way sync of data.
    • Implementation of .ini config file settings for things like debugging, one vs. two way syncing, etc.
    • Integrate into a plugin.

    So far this has been a personal use script. Use at your own risk. I can't guarantee it will work with you setup or that you will not lose or change any data. Backup before you try!

    I used this with Outlook 2003 and 2000 on XP. When I tried on Vista it did not seem to work. I don't know why but it probably has to do with some security settings.

    I have about 50 contacts. Not sure if there are any limitations or if this will work with large contact lists.


    Outlook has built in security that cannot be turned off where Outook prompts for permission for programs to access Outlook contacts via MAPI. I use a freeware program called ClickYes which automatically clicks the yes button when the Outlook prompt pops up. Works fine for me. I believe the default setting in Outlook only gives a 1 minute access, but I have not had any issues syncing and ClickYes seems to work very well.
    Attached Files