Required Field

J

JamesJ

Hi. Can I use an existing form and have require data in one field or
must I create and publish a new form?? I want to require my contacts
to have a Category and my Appointments and Events a Label.

Thanks,
James
 
H

Hollis D. Paul

Hi. Can I use an existing form and have require data in one field or
must I create and publish a new form?? I want to require my contacts
to have a Category and my Appointments and Events a Label.
You can start with an existing form, but you have to publish your new
changes as a new form. Don't use the same name--add at least a version
number--MyForm_v3--so that you will get the proper form when you
request a new item with the added features.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2600
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 
J

John Riddle

You could monitor the Folders that you're adding these items to using VBA
and check the values of the fields when saving or changing items in those
folders (such as your Contacts folder or Calendar folder).

In ThisOutlookSession:

Public WithEvents myOlContactItems As Outlook.Items

Public Sub Initialize_handler()
Set myOlContactItems =
Outlook.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
End Sub

Private Sub Application_Startup()
Initialize_handler
End Sub

Private Sub myOlContactItems_ItemAdd(ByVal Item As Object)
If Item.Categories = "" Then
Item.Display
msgBox "You must add at least one category."
End If
End Sub

Private Sub myOlContactItems_ItemChange(ByVal Item As Object)
If Item.Categories = "" Then
Item.Display
msgBox "You must add at least one category."
End If
End Sub

(something like that, I haven't tested this code, but it will give you an
idea)

This will allow you to not use a custom for to check the categories fields.
This is useful if you use Outlook XP or earlier and don't want to get the
message: "This item contains active content and cannot be displayed in the
preview pane. Please open the item to view it's contents." As would happen
if you have any code in a custom form.

This can be a big limitation to using custom forms in Outlook.

John
 
J

JamesJ

It sounds intriguing but I really don't know how and where to insert
code into these Outlook Forms. I use Access 2003 and have vb code
in my db app but I'm familiar with Access forms and modules. Anywhere
I might learn a bit about using vb with Outlook forms??

James
 
J

JamesJ

I've used custom forms that I've created from existing forms. Will
a new form requiring data apply to existing data?

Thanks,
James

Hollis D. Paul said:
Hi. Can I use an existing form and have require data in one field or
must I create and publish a new form?? I want to require my contacts
to have a Category and my Appointments and Events a Label.
You can start with an existing form, but you have to publish your new
changes as a new form. Don't use the same name--add at least a version
number--MyForm_v3--so that you will get the proper form when you
request a new item with the added features.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2600
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 
H

Hollis D. Paul

I've used custom forms that I've created from existing forms. Will
a new form requiring data apply to existing data?
You have to run a utility to change the Message Class field to the new
custom form's name. You can find a suitable utility on
www.slipstick.com.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2600
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA

See this message from Sue Mosure:
************
From: "Sue Mosher [MVP-Outlook]" <[email protected]>
Subject: Re: Saving a custom form as a default form
Date: Thu, 16 Dec 2004 13:29:18 -0500
Newsgroups: microsoft.public.outlook.program_forms


If you have Outlook 2000 or later, you can make a registry change to
substitute your custom form for the default form. See
http://www.outlookcode.com/d/newdefaultform.htm#changedefault .
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers

*****************
 
J

John Riddle

Slipstick.com is the best resource for Outlook Programming.

The code that I provided would go into the VBA module, not behind a form.
That method would allow you to not have to use a custom form. Outlook forms
use VBScript, not VB. To insert code into a form, open a form in design mode
(Tools-->Forms-->Design a form), then click on the "view code" button on the
design tool bar.

John
 
J

JamesJ

I searched that site for fifteen minutes and could not find the utility.
What is the name of the utility?

James

Hollis D. Paul said:
I've used custom forms that I've created from existing forms. Will
a new form requiring data apply to existing data?
You have to run a utility to change the Message Class field to the new
custom form's name. You can find a suitable utility on
www.slipstick.com.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2600
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA

See this message from Sue Mosure:
************
From: "Sue Mosher [MVP-Outlook]" <[email protected]>
Subject: Re: Saving a custom form as a default form
Date: Thu, 16 Dec 2004 13:29:18 -0500
Newsgroups: microsoft.public.outlook.program_forms


If you have Outlook 2000 or later, you can make a registry change to
substitute your custom form for the default form. See
http://www.outlookcode.com/d/newdefaultform.htm#changedefault .
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers

*****************
 

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