Views

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:

  • Table view. The most commonly used Outlook view, the table view consists of rows and columns that expose the information from the folder.
  • Timeline view. This view shows, as icons, the chronological order of the items in the folder.
  • Card view. The card view shows the items in the folder as individual cards, similar to a business card file.
  • Day/Week/Month view. In this view, items are arranged in a calendar. This view is best used for applications that have a date and time field as one of the application's primary fields.
  • Icon view. The icon view presents all items in the folder as individual icons on an invisible grid. The icon view is best used for items where seeing the details of the item are not important.

Creating New 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:

  1. Right-click on the Outlook toolbar, and select Customize.
  2. On the Commands tab, select Advanced from the Categories list.
  3. On the Commands list, scroll down until you find the Current View drop-down list.
  4. Drag and drop the Current View drop-down list onto your toolbar. You should see Outlook fill in the Current View drop-down list with the name of the current view of the folder. You can now use the Current View drop-down list to create new views by typing over the name in the box.

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:

  • This Folder, Visible To Everyone. This option enables the view to be used on the current folder and to be visible to everyone. Any person with permissions to open the folder will be able to select this view from the drop-down list of current views. As a developer, you can create the views for your Outlook application and then save them so that all your users can use them.
  • This Folder, Visible Only To Me. When you select the private view option, the view is for the current folder but is only visible to the current user. You could use this view if you wanted to show specialized information (like debugging information) to only certain users, not all users of your application.
  • All Folders. This option enables the view to be used in all folders that have the same item type as the current folder. This allows you to share your favorite views across folders of the same type.

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:

  1. Select the Document Library folder in Outlook.
  2. From the View menu, point to Current View, and then click Define Views.
  3. Click the New button, and type a name for your view, such as As Icon.
  4. Select Icon from the Type Of View box.
  5. Select This Folder, Visible To Everyone in the Can Be Used On area.
  6. Click OK. The View Settings dialog box is displayed.
  7. Click the Other Settings button, and select the type of icon you want to use: Large Icon, Small Icon, or Icon List.
  8. Click OK twice.
  9. Click Apply View. We now have an icon view of our Document Library application. Your view should be similar to the view shown in Figure 4-15.
  10. click to view at full size.

    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:

  1. Follow steps 1 and 2 from the preceding procedure above.
  2. Click the New button, and type a name for your view, such as Document Timeline.
  3. Select Timeline from the Type Of View box.
  4. Select This Folder, Visible To Everyone in the Can Be Used On area.
  5. Click OK. The View Settings dialog box is displayed.
  6. Click the Fields button. The Date/Time Fields dialog box is displayed.
  7. Select the Created field in the Available Date/Time Fields list as the starting time for the document in the view, and then click the Start button.
  8. Select All Document Fields from the Select Available Fields From drop-down list.
  9. Select Last Saved Time from the Available Date/Time Fields list, and then click the End button so that the last-saved time is the ending time for the document in the view.
  10. Click OK twice. Click Apply View. The view of your documents folder should be similar to Figure 4-16.
  11. click to view at full size.

    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.

Customizing the Current View

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:

  1. In the Document Library application, create a new table view and name it Document Properties.
  2. Right-click on any column heading in the Document Properties view, and select Field Chooser.
  3. Select All Document Fields from the drop-down list.
  4. Drag and drop Author, Revision Number, and Last Saved Time from the Field Chooser to an area next to one of the columns in the view. Outlook presents red arrows to indicate where the field will be inserted.
  5. To remove a column, select the column heading and then drag and drop it off the column heading row.

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.

Formatting the Columns in a 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:

  1. Right-click on the Last Saved Time column heading in the Document Properties view, and select Format Columns from the context menu.
  2. In the Format drop-down list, select the option that shows only the month, the day, and the year, such as April 07, 1999.
  3. In the Label box, enter Last Edit Time.
  4. Click OK. Your date/time column should look similar to the one shown in Figure 4-17.
  5. click to view at full size.

    Figure 4-17 The new Document Properties view after changing the format and label of the date/time column.

Grouping Items in a View

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:

  • Using the Group By box. This is the easiest method because it allows you to use drag-and-drop functionality to select the column as the grouping. If you drag and drop more than one field into the Group By box, Outlook graphically draws the relationship between the fields as primary groups and subgroups.
  • Customizing the Current View option. This method gives you a few more options when setting the grouping for a view, but it isn't as easy as using the Group By box.

To group items by Author using the Group By box, follow these steps:

  1. Right-click on a column for the Document Library application, and select Group By Box to display the Group By box above the column headings.
  2. Drag and drop the Author column into the Group By box, or drag items from the Field Chooser into the Group By box.
  3. If you want to group by more than one field, drag and drop a second field into the Group By box. For our purposes, drag the Categories field from the Field Chooser to the Group By box. Notice how Outlook draws a line from the Author field to the Categories field to indicate that the view is grouped first by author and then by category. Take a look at Figure 4-18.
  4. Close the Group By box by right-clicking on a column heading and then selecting Group By box.

To create the same grouping using the Current View option, follow these steps:

  1. From the View menu, point to Current View, and then click Customize Current View.
  2. Click the Group By button to display the Group By dialog box.
  3. In the Select Available Fields From drop-down list, select All Documents Fields.
  4. In the Group Items By area, select the Author field. You can also show the field in the view by checking the Show Field In View check box.
  5. In the Select Available Fields From drop-down list, select Frequently-Used Fields. In the first Then By area, select the Categories field. Figure 4-19 shows the completed Group By dialog box.
  6. Click OK twice.
  7. click to view at full size.

    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.

click to view at full size.

Figure 4-19 The Group By dialog box.

Sorting Items in a View

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:

  1. From the View menu, point to Current View, and then click Customize Current View.
  2. Click the Sort button to display the Sort dialog box, shown in Figure 4-20. In the Select Available Fields From drop-down list, select the category, or location, of the field you want to use as your sort criterion.
  3. In the Sort Items By area, select the field that you want to use as your sort criterion.
  4. To select further sorting subsets, select the next field you want to sort by in the Then By area.
  5. Click OK twice.
  6. Figure 4-20 The Sort dialog box in Microsoft Outlook.

Filtering Information in Views

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:

  1. From the View menu, point to Current View, and then click Customize Current View.
  2. Click the Filter button.
  3. Click on the More Choices tab.
  4. In the Categories box, type Outlook; Exchange, as shown in Figure 4-21.
  5. Click OK twice.
  6. click to view at full size.

    Figure 4-21 The Categories filter for the Document Library application.

Here's how to create a complex filter for the Document Library application:

  1. From the View menu, point to Current View, and then click Customize Current View.
  2. Click the Filter button.
  3. Click on the Advanced tab.
  4. Click Field, point to All Document Fields, and then click the Last Saved Time field.
  5. In the Condition drop-down list, select Last Month.
  6. Click Add To List.
  7. Click Field again, point to All Document Fields, and then click the Author field.
  8. In the Condition drop-down list, select Is Not Empty. Click Add To List.
  9. Click Field again, point to All Mail Fields, and then click the Message Class field.
  10. In the Condition drop-down list, select Contains and type this text in the Value box: IPM.Document.Word.Document. Click Add To List.
  11. Click OK twice.

Editing View Settings

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 Editing

The 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.

Conditional Formatting

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:

  1. From the View menu, point to Current View, and then click Customize Current View.
  2. Click the Automatic Formatting button.
  3. Click Add, and type a name for the formatting rule in the Name box, such as Word Documents.
  4. Click the Font button, and select 12-point Arial as the font and red as the font color. Click OK.
  5. Click the Condition button. As you can see, the dialog box is the same as the Filter dialog box we saw in Figure 4-21.
  6. Click on the Advanced tab.
  7. Click Field, point to All Mail Fields, and then click Message Class.
  8. From the Condition drop-down list, select Contains. In the Value box, type IPM.Document.Word.Document.
  9. Click Add To List and then OK.
  10. Click OK two more times. Your screen should look like the one shown in Figure 4-22.
  11. click to view at full size.

    Figure 4-22 The Document Library application after applying conditional formatting for Word documents.

Limiting Views to Only Those Created for the Folder

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 Access

If 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.

Implementing Threaded Views

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:

  1. From the View menu, point to Current View, and then click Customize Current View.
  2. Click the Group By button.
  3. In the Group Items By area, select Conversation and click OK.
  4. Click the Sort button.
  5. In the Sort Items By area, select Conversation Index. To see this property, you might have to select All Mail Fields from the Select Available Fields From drop-down list.
  6. Click OK twice.

Figure 4-23 shows a threaded view.

click to view at full size.

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.



Programming Microsoft Outlook and Microsoft Exchange
Programming Microsoft Outlook and Microsoft Exchange, Second Edition (DV-MPS Programming)
ISBN: 0735610193
EAN: 2147483647
Year: 1999
Pages: 101
Authors: Microsoft Press, Thomas Rizzo
BUY ON AMAZON

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net