As discussed in Chapter 2, Outlook supports a variety of folder views, including custom views, to give you and users flexibility in the presentation and organization of information. These views can be used in any type of Outlook folder. Outlook allows you to set the initial view for a folder, and it remembers the state of the view for each user. Outlook supports five types of views:
Outlook provides two options for creating new views: defining new views with the Define Views dialog box or adding the Current View box to your Outlook toolbar. This second option is the easiest and is the one you will probably use more often. To add the Current View box to your Outlook toolbar, follow these steps:
When you attempt to save your views, Outlook will prompt you to indicate which view will be used. There are three primary ways you can apply your views in Outlook:
So far, our Document Library application is only a folder where users can drag and drop documents to share with other users. By using views, we can transform our simple Document Library application into a more powerful and useful application for our users. The first view we are going to create is an icon view so that our application looks more like a network file share than an Outlook folder. This will make it easier for our users to navigate among the files in the folder. To create the icon view for the Document Library application, follow these steps:
Figure 4-15 An icon view of the information in the Document Library application.
The second view we are going to create is a timeline view. This view will enable our users to quickly see the last time a document was saved and how much time has elapsed between the time the document was created and the time it was last edited and saved. By implementing this feature, users can quickly discard older versions of the document to ensure they are using the most recent version. As you will see in Chapter 5, you can customize your views by using custom properties directly from Office documents.
To create the timeline view for the Document Library application, follow these steps:
Figure 4-16 A timeline view of the Document Library application. Notice how Outlook automatically draws a line indicating the amount of time that has elapsed between the creation time and the last-saved time of the document.
You can customize the current view by using the Field Chooser to drag and drop new columns. After you add the new column, the view is automatically updated using values taken from the items in the folder. You can also add complex data types to the view, such as combination or formula fields. Many people find it easier to customize a view by using the drag-and-drop capabilities of the Field Chooser as opposed to selecting available columns from a drop-down list.
To add new columns to the Document Library view, follow these steps:
NOTE
You can remove columns easily from your view by dragging the columns until a large X appears. Once you release the mouse button, the column disappears from the view.
Notice that when you drag and drop columns from the Field Chooser, Outlook, by default, gives the column heading the same name as the field on which the column is based. Also notice that Outlook applies default formatting for the columns. For example, Outlook automatically formats the Last Saved Time column with the day, the date, the year, and the time the document was last saved. Most users won't need this much detailed information about the last-saved time for the document. To make views more intuitive to your users, Outlook allows you to change the name of the column heading without changing the name of the underlying field. You can also change the default format of values for a specific column in the view. For example, you can change the format of the Last Saved Time column heading so that it only displays the date the document was last saved rather than the date and the time, as we saw earlier. Please note, however, that changing the format of the column does not modify the format of the field on which the column is based. To modify the format of the field, you must use the Field Chooser. To change the format of a column in the Document Library application, follow these steps:
Figure 4-17 The new Document Properties view after changing the format and label of the date/time column.
Grouping items in an Outlook view makes it easy for users to find items that are related. Outlook supports up to four levels of grouping in a single view. You can group items in a view in one of two ways:
To group items by Author using the Group By box, follow these steps:
To create the same grouping using the Current View option, follow these steps:
Figure 4-18 The line connecting the Author field to the Categories field indicates how the items are grouped—in this case, by Author first, and then by Categories.
You now have created the same view using both methods. The only difference between the two is that in the Group By dialog box, you can select whether the groups are expanded or collapsed by default.
Figure 4-19 The Group By dialog box.
Outlook also supports the ability to sort items in a view in either ascending or descending order. When you combine sorting with grouping, you get the best combination of features for making your information available to users in a view. For example, instead of just grouping our Document Library items by author, we can also sort the items so that the most recently saved documents appear at the top of the grouping.
To create a sorted list, you can click on the column heading or use the Sort dialog box. To create a sorted view by using the Sort dialog box, follow these steps:
Figure 4-20 The Sort dialog box in Microsoft Outlook.
Filtering allows you to create views in which only certain information is visible to users. The criteria you set can be built-in Outlook fields or custom fields. Filters can have only one or two conditions or they can be more complex, using multiple conditions or the advanced filtering features. When you set multiple conditions on a filter, Outlook ANDs them together. When you set multiple arguments in a single condition, Outlook ORs these arguments so that if only some meet the condition, the item appears in the view. To create a simple filter for the Document Library application, follow these steps:
Figure 4-21 The Categories filter for the Document Library application.
Here's how to create a complex filter for the Document Library application:
You can customize the formatting of your views at a more detailed level by using the Other Settings dialog box. The type of view you create determines which settings are available for you to edit. For example, if you are editing a table view, you can set the font size, enable in-cell editing, enable autopreview, create gridlines, and enable the preview pane. If you are editing an icon view, you can set the view type, such as Large Icons, Small Icons, or Icon List, and you can specify whether Outlook should automatically arrange and sort the icons in your view.
In-Cell EditingThe in-cell editing option for customizing a table view allows users to quickly add new items to a folder or change the properties of current items in the folder without opening a form. All of the changes to the item can be typed directly into the view. This capability helps speed up applications that require a lot of data entry, such as customer contact lists or surveys.
If you enable in-cell editing in a folder that contains Office documents, you cannot modify the properties of the Office documents directly in the view. These properties are read-only inside of Outlook. You must modify these properties using the Office program that originally created the document.
If your custom view is a table view, you can use the conditional formatting capabilities of Outlook. Conditional formatting enables items that meet certain conditions to use your custom formatting. For example, you can set a condition in the Document Library application so that all Word documents appear in a 12-point, red Arial font. Outlook automatically sets some default formats for the most common conditions, such as unread, expired, and overdue e-mail. You can customize the settings for these default conditions or create your own conditions. To set conditional formatting, follow these steps:
Figure 4-22 The Document Library application after applying conditional formatting for Word documents.
Outlook, by default, provides several standard views in a folder based on the folder's default content type. In many cases, these default views are not relevant to your application, so you will not want them to appear in the Outlook view list. Outlook allows you to hide the default views and only show custom views created for the current folder by checking the Only Show Views Created For This Folder check box in the Define Views dialog box.
Disabling Default Views in Microsoft Outlook Web AccessIf you are planning to use Outlook Web Access as one of the clients for your application, the Only Show Views Created For This Folder property will not disable the default views from appearing in Outlook Web Access. To do this, you have to customize the Active Server Pages of Outlook Web Access to hide the default views for your folder. Any custom table views that you create in the Outlook client will automatically be available to the Outlook Web Access client as long as the Automatically Generate Microsoft Exchange Views check box is checked.
Many times, you'll want to display the information in a folder as a threaded view so that users can see the history of responses to an item. These responses are indented in the view to make it easier to follow the flow of information about the item. In a folder based on e-mail items, Outlook provides a default view called By Conversation Topic, which provides this threading capability. But suppose you don't build your application based on e-mail items but instead build it based on tasks. To create threaded views in these types of folders, Outlook supports two unique properties called Conversation and Conversation Index.
The conversation field is based on the message's subject field. This means that when you create a new item in a folder, the conversation field is automatically filled with the content of the item's subject field, so any replies inherit the conversation field from the original item.
The conversation index is a unique identifier used by Outlook to track the series of responses to an item. This index allows Outlook to know which item in the thread the user is responding to and where the response should be placed in the threaded view.
To implement threaded views for any of your Outlook folders, you must group by the conversation field and sort in ascending order by the conversation index. The sort by conversation index is usually the step that most developers forget about when trying to implement threading. Without it, your view will be grouped only by the conversation index and will be void of any indented text indicating responses to items.
To implement threaded views in Outlook folders, follow this procedure:
Figure 4-23 shows a threaded view.
Figure 4-23 A threaded view of a Group Tasks public folder.
NOTE
In all folders except those based on e-mail items, Outlook does not automatically make the Post Reply To This Folder menu option available. This menu option allows you to post replies in a folder that automatically inherit the conversation property from the original item. To enable this menu option, you can add this command to the Outlook menu or toolbar.