Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site

       How did you like this article? Please vote and let us know.          

Subscribe to OutlookExchange
Anderson Patricio
Ann Mc Donough
Bob Spurzem
Brian Veal
Catherine Creary
Cherry Beado
Colin Janssen
Collins Timothy Mutesaria
Drew Nicholson
Fred Volking
Glen Scales
Goran Husman
Guy Thomas
Henrik Walther
Jason Sherry
Jayme Bowers
John Young
Joyce Tang
Justin Braun
Konstantin Zheludev
Kristina Waters
Kuang Zhang
Mahmoud Magdy
Martin Tuip
Michael Dong
Michele Deo
Mitch Tulloch
Nicolas Blank
Pavel Nagaev
Ragnar Harper
Ricardo Silva
Richard Wakeman
Russ Iuliano
Santhosh Hanumanthappa
Shannal L. Thomas
Steve Bryant
Steve Craig
Todd Walker
Tracey J. Rosenblath

 

 
 

The custom form allows the selection of a specific contact from all the items for a company in the contact folder. Also attached is a text file that describes how it might be set up in a folder, and then presents a brief functional description of the various subroutines. If you want different kinds of descriptions to go with the form, let me know an I will write them up.

Hollis D. Paul [hdp@compuserve.com]

form.gif (1080 bytes)
Link to Action1.OFT

ActionItem1: Select Contact

ActionItem1 is a Outlook custom contact form/item with code behind it to list the distinct companies in a contact folder in listbox1, upon selection of a specific company from the listbox1, displays the list of contacts for that company, and displays the contact item for the individual selected in listbox2. The Company Name listbox has an optionbutton to clear the listboxes and and an optionbutton to relist the company names. The Contact Name listbox has an optionbutton to create a new contact item for the selected company and preloads it with several fields. As currently coded, the new item appears in the contact folder in which the actionItem exists. Alternative destinations can be used, like the default contact folder for the service profile, or any named contact folder. The code for these alternate destinations is shown in comment lines in the code behind the form.

The custom form can be loaded as a real contact item which sits at the front of the list, or can be published to the contact folder. I have tested it both ways. I prefer it as a real item, because it shows as just a Title Line in a card view in the Contact Pane when the pane is opened. One could have several action items listed there to do several common functions.


The custom form hides everything but P.2. On P.2 there are the following controls: Frame1 labeled Select Company Name; OptionButton1,2,3; ListBox1 Frame2 labeled Select Contact Name; OptionButton4,label1,6; Listbox2 In operation as coded, the ActionItem1, which is the item that contains the code, is invoked (double clicked) from the contactsFolder display: During the Item_Open event, pages are hidden, option buttons are initialized and everything in Frame2 is disabled. OptionButtion2_Click subroutine is called from the Item_Open event.

OptionButton2_Click Subroutine: Defines the HostFolder for the restricted/search function, sets the FindString for the search function, performs the restriction/search, sort it by company name, defines an array to contain the CompanyName field, and the restricted set Index from the restricted/search set, marks duplicates, and loads the CompanyName field into ListBox1 item list. Still pending is finding out how to use the Sort method to sort the items in the restricted set.

The ListBox1_Click subroutine enables the controls in Frame2, sets the selected CompanyName in a global variable, and calls the OptionButton5 subroutine.

OptionButton4 subroutine: creates a new contact, copies the company name to the companyname field, copies address, business phone and business fax, sets a dummy fileas field, displays the new contact item and closes the action item.

OptionButton5 subroutine: Sets the FindString to limit the restriction set to just the contacts that have the same CompanyName value, loads the FullName field into the item list of ListBox2.

ListBox2_Click subroutine: Takes the ListBox2 index, grabs up the indicated item from the restricted set, displays it, and closes the current item saving all values. (Very useful while developing code in the custom form. Will be changed to discard when the final form is published.)


Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Pro Exchange. OutlookExchange.Com and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

© Copyright Pro Exchange, Inc., 2006