This library is an extended version of a simpler one that that I produced in response to a query in another thread. Used in conjunction with the Outlook library it lets a user either choose a contact from a contact list, or choose a specific property of a pre-selected contact. There are facilities to restrict the list of contacts available to the user to a selected sub-set of the full list.
The library requires .NET 2.0 and WM5.0 or later on the device. A dummy library to ease development on the desktop is also provided. That requires .NET 2.0 also. A help file is included but there is no demo as the use of the library really depends upon the contents of your Outlook contacts list.
EDIT:- Version 1.1 posted. See post #7 for details.
If ChooseProperty is false (the default) then the dialog returns a contact chosen by the user that you assign to a Contact object from the Outlook library and take it from there.
Code:
... OutlookContact.New1 ' only need to do it once ...
If ChooseContact.Show = cOK Then' dialog OK ' assign the selected contact reference to an Outlook library Contact object OutlookContact.Value = ChooseDialog.SelectedContact ' now all the properties should be available tbxFirstName.Text = OutlookContact.FirstName tbxLastName.Text = OutlookContact.LastName .... EndIf
You don't have the Windows Mobile assemblies Microsoft.WindowsMobile.Forms.dll or Microsoft.WindowsMobile.PocketOutlook.dll on your desktop as they are not part of the Compact Framework 2. Remove ChooseContactDialog.cs from your Libraries folder and use the ChooseContactDialog.dll on the device.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
But now I have another problem in conjunction with the Outlook.dll
In the test program, when I try to assign the selected contact to an outlook contact I get the first message below.
I commented out this line and put
Contact.Value = ChooseContact.SelectedContactName
the IDE compiles, but on the device i get an error.
Version 1.1 now posted to try to resolve the optimised compiled problem above. I had to scratch my head for a while as it was not a reference problem but seemed to be due to an unintended difference between the desktop and device libraries but I still don't understand why it produced that particular error - hopefully now fixed. It looks like I only tested in the IDE without optimised compiling, when it would work. I wonder why nobody has found this before - it had about 80 downloads? Maybe they gave up in disgust!
Sources are no longer included as most people don't have the Outlook libraries available on their desktop that are needed for compilation. As I have Visual Studio and the WM5.0 SDK I do have then but I overlooked the fact that most don't. This is probably why Erel doesn't include the source for Outlook.dll in the libraries folder.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
That works fine but I wold like to use the Selected property as shown on the picture below instead of Contact.MobileTelephoneNumber. When I set ChooseDialog.ChooseProperty = True then it does not show the dialog at all.