Outlook form - Checkbox - Change background color

S

Simon Minder

Dear all,

Let's assume I have 15 contacts. 5 of these contacts are clients and I would
like to have a different background color of the contact form for these
contacts that all employees know that these contacts are clients. The
contacts are stored in the Public Folders.

Any ideas how I could add a checkbox (add a custom tab) that if the checkbox
is checked that the background color of this form would change (> all
pages/tabs > General, Details, Activities, etc.)?

Kind regards,

Simon
 
R

Roady [MVP]

You can design your own custom contact form for this;
Tools-> Forms-> Design a Form...

You can publish this form to the Public Folder and create new contacts with
this form.
 
S

Simon Minder

Dear Roady,

Thanks. Do you have any ideas how I could do that best? Do I need VBA or VB
Script?

Best wishes,

Simon
 
S

Sue Mosher [MVP]

Code behind custom forms is VBScript. See
http://www.outlookcode.com/article.aspx?ID=38 for details on the syntax used
to respond to a user clicking a check box.

In the future, you can post Outlook programming questions on that site or in
the new Outlook for Developers forum at
http://social.msdn.microsoft.com/Forums/en-US/outlookdev/threads. This
current forum where you've posted is slated to be discontinued any day now.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
S

Simon Minder

Hi Sue,

I wrote the following code and I have to problems:

1. If I use the "Run This Form" button the event works and the message
box is displayed. However, if I publish the form and I open the form, the
form is not message box will not appear.

2. With Office 2010 the public folder includes your e-mail address. How
can I refer to a generic name that the code will use for all users (marked
with XXXXXX in the code.

Function Item_Open()

' Set the NameSpace object
Set objOLNS = Application.GetNameSpace("MAPI")

' Set the Contacts folder, which is in the MAPI NameSpace
Set objContactFolder = objOLNS.Folders("Public Folders - s.minder@XXXXXX"). _
Folders("All Public Folders"). _
Folders("MFO Contacts")

' Set the collection of all Contact items
Set objAllContacts = objContactFolder.Items

' Set the object referring to the form page the combo box is on
Set objFormTab = Item.GetInspector.ModifiedFormPages("MFO")

Set objSEC = objFormTab.Controls("CheckBox6")

If objSEC = True Then

MsgBox"This is a SEC client!"

End if

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top