Mitdasein in the experience of encountering the customer in our common having been cast into the opening of beyng

Monday, May 08, 2006

Set an Account property through VBS

Here's a short script that creates an Account and sets a pull-down property in BCM v2. Have Outlook/BCM running in the profile you want to use.


' SetStatus.vbs
' Create BCM v2 Account and set "Business Status" property to "Current"

set oOL = CreateObject("Outlook.Application")
set oNS = oOL.GetNamespace("MAPI")
set oBCMFolder = oNS.Folders("Business Contact Manager")
set oBCMAccountsFolder = oBCMFolder.Folders("Accounts")
set oItems = oBCMAccountsFolder.Items
set oAccount = oItems.Add("IPM.Contact.BCM.Account")
oAccount.FullName = "Wu Ming"
set oProperties = oAccount.ItemProperties
oProperties("Business Status").Value = "Current"
oAccount.Save()


In BCM v3 this property has changed and is now a checkbox.


' Create Account and set Active ("Status") property to false

set oOL = CreateObject("Outlook.Application")
set oNS = oOL.GetNamespace("MAPI")
set oBCMFolder = oNS.Folders("Business Contact Manager")
set oBCMAccountsFolder = oBCMFolder.Folders("Accounts")
set oItems = oBCMAccountsFolder.Items
set oAccount = oItems.Add("IPM.Contact.BCM.Account")
oAccount.FullName = "Wu Ming"
set oProperties = oAccount.ItemProperties
oProperties("Active").Value = 0
oAccount.Save()

0 Comments:

Post a Comment

<< Home