This article provides an overview of the Microsoft Outlook 2000 View Control.
The Microsoft Outlook View Control displays information about a specific folder and can be integrated into solutions to provide access to Outlook data. The control can be placed in any container that supports ActiveX controls, including an HTML page, a Microsoft Visual Basic form, a Microsoft Visual Basic for Applications UserForm, or a custom Outlook form. You can programmatically set the control's properties to customize the folder and view that is displayed in the control.
You can use the control to create a variety of solutions that are designed to integrate Outlook data. For example, you can place multiple view controls on an HTML page so that a user can view the contents of more than one folder within a single window. This can be useful in a scenario where you want to display calendar information for more than one user at once.
One of the key features of the Outlook View Control is that you can use the Restriction
property of the control to filter out certain types of data. For example, you can display the Tasks folder in the Outlook View Control, and then filter the folder to show only those tasks for a certain contact.IMPORTANT
: There are differences in how the control functions depending on whether or not the control is being used in an Outlook folder home page. These differences include features of the Outlook View Control itself, in addition to the Outlook features that the Outlook View Control exposes. The differences exist because if the control is used from within Outlook, it can access information that is not exposed when the control is run externally to Outlook. It is often helpful to know that these differences can occur. If you are intending to use the control outside of Outlook, you may want to test the control's behavior on an Outlook folder home page to see if there are any differences. Likewise, if you are intending to use it on a folder home page, you may want to test the HTML page in a browser to make sure that the same functionality is provided. Following are limitations of the Outlook View Control when it is not used on an Outlook folder home page:
- Retrieving the OutlookApplication property (you can use CreateObject("Outlook.Application") instead)
- Retrieving the Folder property (although it can be set)
- Retrieving the ActiveFolder property
Information About the Updated View Control
For security reasons, changes were made to the Outlook View Control to limit its functionality when the control is hosted outside of Outlook. In particular, the View
property cannot be changed unless the control is used within Outlook.IMPORTANT
: One side effect of this change is that if you use the control in an HTML page, and then use the <Object> tag to set the View
property, all of the other properties you specify are not applied. A typical symptom that occurs after you use the updated Outlook View Control is that the control displays the Inbox even though you specify a different folder parameter. To work around this behavior, you can either remove the View
parameter completely so that it does not affect the other parameters, or you can use a scripting language to programmatically set the property, as shown in the example provided later in this article.
How to Obtain the Outlook View Control
The Outlook View Control is included in the Outlook 2000 Team Folder Kit and must be downloaded from the Web. It is not included with Microsoft Office 2000 or Outlook 2000. For additional information about where to download the Team Folders Kit, click the article number below to view the article in the Microsoft Knowledge Base:
OL2000: (CW) General Information and System Requirements for Team Folders
The control is stored in a .cab file called Outlctlx.cab, which contains the Outlctlx.dll and Outlctlx.inf files. The control is also posted on the Microsoft Web site, so the control can also be installed on a computer on demand.
How to Install the View Control on Your Development Computer
The Outlook View Control dynamic link library (.dll) is stored in a .cab file called Outlctlx.cab. The .cab file also contains an .inf file to install the .dll.
If you install the Team Folders Kit on your computer, Outlctlx.cab is placed on your hard drive so that it can be installed when you install the Team Folders Wizard. However, if you do not want to install the Team Folders Kit or Wizard on your computer, you can use an extraction utility to extract the necessary files.
You can use any of the following methods to install the control on your development computer:
- Install and use the Team Folders Wizard, which installs the Outlook View Control.
- If you do not want to install Team Folders, the preferred method to install the control is to use the .inf file. In Windows Explorer, right-click Outlctlx.inf, and then click Install.
- Use Regsrv32.exe to register the Outlctlx.dll file.
- Use a Codebase attribute in an HTML file to automatically install the control from the following Microsoft Web site: For example, if you load the following HTML page in a browser, it automatically installs the control, assuming that the browser's security settings are configured to allow the control to be installed:
<html><head></head><body><OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046id=ViewCtlFolder width="100%" height="430" codebase="http://activex.microsoft.com/activex/controls/office/outlctlx.CAB#ver=9,0,0,3203"></OBJECT></body></html>
How to Find and Install Documentation for the View Control
Documentation for the Outlook View Control is in the Help file (Ovctl.chm). The file is initially installed in the Docs subfolder of the folder in which the Microsoft Outlook Team Folders Kit is installed (by default, C:\Tfkit\Docs). Copy Ovctl.chm to the Help folder in your Windows folder (for example, C:\Windows\Help). After you do this, if you are using the Outlook View Control in a development environment such as Microsoft Visual Studio or the Microsoft Visual Basic Editor, you can view context-sensitive Help topics for the control's methods and properties in the usual way.
How to Use the Outlook View Control in Development Environments
The Outlook View Control is primarily designed to be used in an HTML page, such as an Outlook folder home page, so the properties of the control are primarily designed to be set programmatically.
In HTML, you can use the <OBJECT> tag, and then set the properties of the control by using parameters. As an example, the following HTML code illustrates how to set which folder and view to display:
<html><head></head><body><OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046 id=ViewCtlFolder width="100%" height="430"codebase="http://activex.microsoft.com/activex/controls/office/outlctlx.CAB#ver=9,0,0,3203"> <param name="Namespace" value="MAPI"> <param name="Folder" value="Calendar"> <param name="View" value="Day/Week/Month View With AutoPreview"> <param name="Restriction" value=""> <param name="DeferUpdate" value="0"></OBJECT></body></html>
Or, you can use a scripting language to programmatically reference the control and set the properties by using script. For example, the following HTML code uses Microsoft Visual Basic Scripting Edition (VBScript) to display the contents of a delegate's folder:
<html><head></head><body><BUTTON id="cmdButton" onclick="ViewResource();">Show Resource Calendar</BUTTON><BR><OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046 id=ViewCtl1 width="1" height="1"Codebase="http://activex.microsoft.com/activex/controls/office/outlctlx.CAB#ver=9,0,0,3203"></OBJECT></body><script language=VBScript> ' Change "recipientname" to a valid alias of someone who has given ' you permission to view a folder. CONST oRecipName = "=recipientname" ' The list of constants for the folder types you can specify below: CONST olFolderDeletedItems = 3 CONST olFolderOutbox = 4 CONST olFolderSentMail = 5 CONST olFolderInbox = 6 CONST olFolderCalendar = 9 CONST olFolderContacts = 10 CONST olFolderJournal = 11 CONST olFolderNotes = 12 CONST olFolderTasks = 13 CONST olFolderDrafts = 16 Sub ViewResource() If cmdButton.Value = "Show Resource Calendar" Then viewCtl1.Width = "100%" ViewCtl1.Height = "80%" ViewCtl1.OpenSharedDefaultFolder oRecipName, olFolderCalendar cmdButton.Value = "Hide Resource Calendar" Else viewCtl1.Width = "1" ViewCtl1.Height = "1" cmdButton.Value = "Show Resource Calendar" End If End sub</script></html>
Visual Basic and Visual Basic for Applications Environments
You can add the Outlook View Control to a custom form in Visual Basic or Visual Basic for Applications. However, setting control properties at design time may be problematic. For example, in Visual Basic, if you click the ellipses (...) button in the Properties window, you receive the following error message:
System error &H800040002 (-2147467262). No such interface supported
The Outlook View Control has multiple states; if you click the control once, it does not select the control in the design environment, but rather places focus within the Outlook folder. To select the control so that you can view its properties or delete it, follow these steps:
- Display the form that contains the Outlook View Control.
- Right next to the control, click the form, and then hold down the left mouse button.
- Drag the mouse over the control.
- Release the mouse button.
After the control is selected in this manner, you can press the DELETE key to remove it from the form.IMPORTANT
: If you are using the control on a Visual Basic form, be especially careful because it is possible to send keystrokes directly to Outlook. This can cause adverse effects, such as deleting items in a folder, if you press the appropriate keystrokes.
How to Deploy the Outlook View Control
If you are developing an HTML-based solution, and the users have access to the Internet, you should ideally use the Codebase
attribute of the <OBJECT> tag to automatically install the control from the Microsoft Web site. If all users in your organization do not have access to the Internet, you can store the Outlctlx.cab file on an internal Web server, and then modify the URL in the Codebase
attribute to point to that location.
If you are using the control in a custom solution and have no control over the end-user's configuration, you need to redistribute and manually install the control using the Setup program that installs your solution.IMPORTANT
: If you are an Independent Software Vendor selling your solution, you must re-distribute the entire Team Folders Kit along with the Outlook View Control. You do not need to install Team Folders on the user's computer, but it must be available on the distribution media. This is a licensing requirement for the Outlook View Control.
Common Issues with the Outlook View Control
For additional information about questions or problems related to the Outlook View Control, click the article numbers below to view the articles in the Microsoft Knowledge Base:
OL2000: Conflict Using Exchange Extension and Outlook View Control
OL2000: Outlook View Control's Restriction Property Doesn't Work
OL2000: Outlook View Control Cannot Access the File System
OL2000: You Cannot Change the Date in the Outlook View Control
OL2000: Error Message When You Use Outlook View Control on MultiPage Control
OL2000: Cannot Use Preview Pane in Outlook View Control