jlabrou

Hi,

I'm trying to access accounts and contacts of BCM using code below(without success):

Dim a As Outlook.SelectNamesDialog = Nothing

Dim oAL As Outlook.AddressList = Nothing

a = OutlookApplicationObject.Session.GetSelectNamesDialog

olFolder = _lib.OutlookApplication.Session.Folders("Business Contact Manager").Folders("Accounts")

For Each oAL In OutlookApplicationObject.Session.AddressLists

If oAL.GetContactsFolder.FolderPath = olFolder.FolderPath Then

Exit For

End If

Next

MsgBox(oAL.AddressEntries.Count) '<-- Items are 0

a.InitialAddressList = oAL

a.Display

The AddressLists of BCM Accounts and Contacts are displaying as groups in SelectNamesDialog

but there are not any items inside the groups.

Do you know how can i make this work

Thanks,

John



Re: Visual Studio Tools for Office How can i use BCM accounts and contacts with SelectNamesDialog?

X4U

Hello John,

as I know you can set a flag on a ContactFolder to make it Visible in the AddressBook.

You can do it manually (right click Folder -> show as AddressBook) or by code like this:

olFolder = _lib.OutlookApplication.Session.Folders("Business Contact Manager").Folders("Accounts")

olFolder.ShowAsOutlookAB = True

olFolder.AddressBookName = "Bussiness Contacts"

For each...

Hope this helps,

greets, Helmut






Re: Visual Studio Tools for Office How can i use BCM accounts and contacts with SelectNamesDialog?

jlabrou

Hi Helmut,

Thanks for your help(this is the 2nd time)

This flag that you mention is set to "True" by default.

The problem was that the contacts must have a valid email address in order to displayed in SelectNamesDialog object.

But somehow outlook uses this(or a kind of this) form when you try to link an account with an entity using "Link To..." button.

In my case i don't care if contact have email address, all i want is to select it.

I suppose that i have to solve it by myself using magic tricks as always with outlook.

As i said before this is the 2nd time that you helping me when NOBODY else can't do it

(including microsoft specialists who answering problems like "how can i add a button in outlook toolbar"

and they don't even have BCM installed in their pc)

I has starting to thinking the i'm the only one who have serious problems with outlook and the worst is that

i can't rely on BCM sdk.

If it's ok with you i have a couple of questions more to ask you.

I appreciate your help,

John





Re: Visual Studio Tools for Office How can i use BCM accounts and contacts with SelectNamesDialog?

X4U

Hi John,

thank you for the flowers,

- I haven't BCM installed too

- Asking questions and posting here in the Forum ist good - because more specialists / users can answer and other users can search for answers and known issues and Microsoft can see where are the real world problems.

If you want to hire me as consultant for an specific problem or helping you develop something - thats another story.

So feel free to post here or contact me at http://www.x4u.de

Greets Helmut






Re: Visual Studio Tools for Office How can i use BCM accounts and contacts with SelectNamesDialog?

Sue Mosher - Outlook MVP

Outlook does not use the Select Names dialog for presenting contents for the user to link to. It displays the entire folder contents. The Outlook object model does not provide an equivalent method, but there's no reason you couldn't design your own Windows form that presents the folder contents in a modal dialog that has a list box on it showing the folder contents. The new Table object makes it very easy and fast to fill a list box with the contents of a folder.



Re: Visual Studio Tools for Office How can i use BCM accounts and contacts with SelectNamesDialog?

jlabrou

Hi Sue,

Do you know why i choose to extend outlook instead of create a new project from scratch

Because outlook already have entities like customers, opportunities, contacts, etc.

and i want to take advantage of these entities and of course of all relative objects from these entities like

search for an account, link an account, etc.

If i have to remake all these forms by myself then why i have choose outlook





Re: Visual Studio Tools for Office How can i use BCM accounts and contacts with SelectNamesDialog?

Sue Mosher - Outlook MVP

You already answered your own question: "Because outlook already have entities like customers, opportunities, contacts, etc."

Outlook does not, however, make all its dialogs accessible to programmers. The dialog that appears when the user wants to link an item to a contact is one of those not exposed to programmers. If you want something similar, you'll have to build it yourself.

Note also that BCM is itself an add-in, with its own database-driving data store and its linking structure that is totally separate from the linking structure built into Outlook. So if you're building on BCM accounts and opportunities, you're already building on something that isn't entirely Outlook.