More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

forum 23-May-2019 09:51

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

    Page [ 1 ]  
 Outlook Form Design Printer Friendly Version
Designing custom Outlook forms and form regions and writing code for them
Making a form Read Only
We have a form that is no longer being used for data entry however folks may still need to pull it up and view the information contained. How can we make it read only? There are multiple fields that will need to be restricted. Is there a 1 property fits all for this? BTW, Sue if you read this, your book is a God Send! It makes my life so much easier!!!! Thanks for your help!

Will McF.

  20-Jul-2004  15:14
  20-Jul-2004  15:29   
One approach that gives the user proper UI feedback would be to modify the form to set all the controls to read-only. You can do this quickly by selecting the controls, right-clicking, choosing Advanced Properties, then setting the Locked property to True.
  20-Jul-2004  16:03   
Sue, you are the best! Thanks so much. Any help you could give me on my other question regarding form validation would be huge!!! Again Thanks for being such a wonderful resource. Let us know when your next book comes out so we can at least contribute to you for all of the knowledge you've give to us!
  21-Jul-2004  08:18   
You can also disable the whole page by putting the following in the Item_Open() event;
Item.GetInspector.ModifiedFormPages("P.2").Enabled = False
where P.2 is the name of the page. This will disable all controls on the page.
  21-Jul-2004  09:47   
Cool! I never knew that!
  07-Jul-2005  21:01   
Only one problem with that code Jeff. It disables the scroll bar. So if your users have a low resolution set or there is more then a screen full of information on your form, you are out of luck.
  18-Apr-2008  06:42   
Hi! What if I want to make the form read-only ONCE it was sent? or maybe just only a few of the fields that are read-only?
  18-Apr-2008  07:40   
Amir, you could design the read layout of the form so that only certain controls are editable. Or if you have a more complex case with multiple possibilities, put code in the Item_Open event handler to disable individual controls. See for details on control syntax.
    Page [ 1 ]