Microsoft KB Archive/182349

From BetaArchive Wiki
Knowledge Base


OL98: Questions About Custom Forms and Outlook Solutions

Article ID: 182349

Article Last Modified on 4/18/2003



APPLIES TO

  • Microsoft Outlook 98 Standard Edition



This article was previously published under Q182349


SUMMARY

This article provides resources and answers to commonly asked questions about how to create custom solutions by using Outlook forms, Visual Basic Scripting Edition (VBScript) and Visual Basic for Applications automation.

Topics are categorized in the following areas:

MORE INFORMATION

Resources

There are a variety of resources that are available to help you develop Outlook solutions. For additional information about where to find these resources, click the article number below to view the article in the Microsoft Knowledge Base:

180826 OL98: Resources for Custom Forms and Programming


Items and Outlook Custom Forms

Q: I have created a custom Outlook form, but it is not used when I create a new item or when I open an existing item that I had before I created the form. Why is my form not used?

A: To use a custom Outlook form in a typical folder-based form solution, there are three steps that you need to complete:

  1. Publish the form in the folder or forms library where you want to use it. On the Tools menu in the custom form, point to Forms, and then click Publish Form. The name of the form is also the Message Class, which is important for the next two steps. If you are not sure where to publish the form, click the article number below to view the article in the Microsoft Knowledge Base:

    264118 OL98: How to Determine Where to Publish a Form

  2. Make this new form the default form for that folder. To do this, right-click the folder, and then click Properties. In the When posting to this folder box, click your custom form, and then click OK. New items that you create will use the custom form instead of the default Outlook form.
  3. If you have any existing items in the folder that you want to use this new form, change the Message Class field in each of the items in the folder. The Message Class field of an item tells Outlook which form to use to display the item. You cannot directly change this field in Outlook because it is considered read-only, but you can use programming code and the Outlook object model to change the message class of the field.For additional information about how to change the message class of items in a folder and utilities to help you do this, click the article number below to view the article in the Microsoft Knowledge Base:

    182274 OL98: How to Update Existing Items to Use a New Custom Form

Q: How can I disable the macro warning message when someone opens an item?

A: If the form is not located in a trusted location, such as the Organizational Forms Library on an Exchange Server-based computer, Outlook displays the macro warning message to protect you from potentially malicious programming code, commonly called macro viruses. You cannot directly prevent the warning message from appearing; you must publish the form to a trusted location. For additional information about this issue and other reasons why you may receive this warning message, click the article number below to view the article in the Microsoft Knowledge Base:

182376 OL98: Why Outlook Displays a Security Warning Message When You Open an Item


Q: I entered design mode to change a form that I created, but now I cannot select any of the controls on the form page. Why?

A: This is a problem in Outlook 98 that you can work around by switching to a different form page and then switching back to the page that you want to edit. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

183327 OL98: Cannot Select Controls in Design Mode


Q: I created a custom form, but when I close and then open the item again, or when I send the form to someone else, all of the information that I entered into my custom controls is gone. Why does this happen?

A: In Outlook, controls on a form are used to display information, but the information is actually stored in fields. Therefore, for the values of the controls to be preserved, the control must be bound to an Outlook standard or user-defined field. For additional information about this issue, click the article number below to view the article in the Microsoft Knowledge Base:

182362 OL98: How to Use Fields and Controls with VBScript


Q: User-defined fields are not working the way that I expect them to work. Why?

A: User-defined fields offer flexibility in how data is structured within a folder, but this flexibility can also provide some challenges for solution developers. For additional information about how to use user-defined fields in Outlook, click the article number below to view the article in the Microsoft Knowledge Base:

185050 OL98: Working With User-defined Fields in Solutions


Q: Why do some items in a folder have different icons? Why do some items in a folder have an abnormally large size? Why does the Message Class of an item change back to the default Message Class? How can I better understand how forms work in Outlook?

A: Understanding the difference between forms and items and how the two relate to each other is important when you design an Outlook solution. In most scenarios, forms are published to a location and then linked to the items in the folder. However, you can store the forms in individual items, and this can cause the behavior of Outlook to change in many ways. For additional information about form definitions and how they relate to items, click the article number below to view the article in the Microsoft Knowledge Base:

181266 OL98: Working with Form Definitions and One-Off Forms


Q: When I import or export contacts from an external database, how can I map some of the fields to the user-defined fields that I have set up in a custom contact form?

A: This is a limitation of the Outlook Import and Export Wizard. There is no way to directly import or export data into user-defined fields. If you are familiar with Visual Basic programming, you can create a solution that programmatically imports or exports the information. For additional information about this issue and an example of how to import user-defined fields, click the article numbers below to view the articles in the Microsoft Knowledge Base:

180829 OL98: Cannot Import or Export User-Defined Contact Fields


208232 OL2000: How to Programmatically Import Outlook Items from Microsoft Access


Q: Why are all of the items not exported when I try to export them to a folder?

A: Outlook 98 does not export items if they are based on a custom form, meaning that the message class field of the item is not the default message class for that type of item, such as IPM.Contact or IPM.Note. For additional information about this issue, click the article number below to view the article in the Microsoft Knowledge Base:

184677 OL98: All Items in Folder Are Not Exported


Q: When I use a control on a custom Outlook form, why do none of the control events appear to work?

A: When you use a custom Outlook form, Outlook only supports the Click event for controls. Many controls are specifically designed to work with other events, and because these events are not supported by Outlook, the controls may not function in Outlook.

To work around this limitation, you can create a Visual Basic ActiveX component (formally called an OLE server application). You can start the component by using the CreateObject method in VBScript. The component can display a Visual Basic form with the appropriate controls, receive the information that the user selects or types, and then automate Outlook to send any necessary information back to the Outlook form.

This technique involves many aspects of programming. For information about how to create an ActiveX component, see the documentation for Microsoft Visual Basic.

For additional information about control events on Outlook custom forms, click the article number below to view the article in the Microsoft Knowledge Base:

231594 OL98: Click Event Behavior for Standard Controls


Q: Can I print forms as they appear on the screen?

A: There is no direct way to print forms as they appear on the screen. Also, the Outlook object model does not provide more printing functionality than that which is provided by Outlook itself. To work around this limitation, you can either use another program to print Outlook information, or you can download a ActiveX control or Outlook extension to create a custom form printing solution. For additional information about how to create custom form printing solutions, click the article number below to view the article in the Microsoft Knowledge Base:

194802 OL98: Outlook Does Not Print Forms as Expected


Q: Can I design a form in Outlook 98 and use it with previous versions of Outlook?

A: This is generally not a good idea. To help ensure compatibility, design the form by using the earliest version of Outlook that uses the form. For additional information about designing forms to use with more than one version of Outlook, click the article number below to view the article in the Microsoft Knowledge Base:

260223 OL98: Designing Custom Forms for Different Versions of Outlook


Q: How can I change the default mail message form? I have tried to change the default form for my Inbox, but I receive an error message.

A: If you want to change the default form that is used for all items of a specific type, you cannot do this with Outlook 98. Outlook 2000, however, does support this functionality. But if you want to change the default form for only a specific folder but you cannot do it, there is a work around that allows you to indirectly set any type of form as the default form for a folder. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

266329 OL98: How to Set Any Form as the Default Form for a Folder


However, in the case of your Inbox, items that arrive always have their typical message class and you cannot change this dynamically.

Q: How can I get option buttons to work on an Outlook form?

A: You need to follow specific steps for option buttons to function in Outlook. For additional information about how option buttons work, click the article number below to view the article in the Microsoft Knowledge Base:

187963 OL98: How to Use Option Buttons on an Outlook Form


Q: I see there are new fields available in Outlook 98 for the contact form, but how can I use them?

A:For additional information about using the new Outlook 98 contact fields, click the article number below to view the article in the Microsoft Knowledge Base:

185239 OL98: Using the New Contact Fields on a Custom Form


Q: How can I manipulate the Message or Notes field on a form?

A: If your mail format is set to Outlook Rich Text format, Outlook provides limited support for manipulating the body of a message. However, if you use Hypertext Markup Language (HTML) format or Microsoft Word as your e-mail editor, you can create highly formatted e-mail messages. For additional information about working with the body of an item, click the article number below to view the article in the Microsoft Knowledge Base:

183209 OL98: Working With the Message or Body of an Outlook Item


Q: How can I start another program or display a Web page from an Outlook form?

A: You can use the CreateObject method in VBScript to automate an COM-aware program. For additional information about this issue, click the article numbers below to view the articles in the Microsoft Knowledge Base:

181206 OL98: How to Start Another Program from an Outlook Form


181267 OL98: How to Display a Web Page in an Outlook Form


Q: I am trying to use custom icons for items but they do not seem to be consistent and they change unexpectedly. Why?

A: There are a variety of reasons why custom icons may not seem to work correctly. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

182363 OL98: Custom Form Icon Does Not Display


The Object Model and Other General Questions

Q: How can I get started integrating Outlook into another program?

A: You can use automation to programmatically control Outlook from another custom program. For additional information about automating Outlook, click the article number below to view the article in the Microsoft Knowledge Base:

181202 OL98: How to Automate Outlook from Another Program


Q: Before I start to develop a solution, how can I find out if someone has already developed something that I am planning?

A: The Slipstick Systems Web site provides a comprehensive summary of add-ins and utilities. For more information about these add-ins, view the following Slipstick Web site:

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Q: What effect can the Outlook E-mail Security Update have on solutions that I develop?

A: As a developer, you should fully understand the implications of the Outlook E-mail Security Update. For additional information about the security update and links to other resources that are related to the update, click the article number below to view the article in the Microsoft Knowledge Base:

262700 OL98: Developer Information About the Outlook E-mail Security Update


Q: How can I programmatically refer to a particular Outlook folder or a particular item? How can I create a new folder or item?

A: Outlook provides many ways to programmatically access and manipulate items and folders. For additional information about how to work with folders and items, click the article number below to view the article in the Microsoft Knowledge Base:

182614 OL98: Programming Examples for Referencing Items and Folders


Q: Why can I not figure out how to do something? Is it possible?

A: Outlook does not support a full object model, such as those in Word or Microsoft Excel, so what you are trying to do may not be possible. Also, there may be other Outlook design considerations or limitations that may prevent you from using the approach that you want to create a solution. For additional information about this, click the article number below to view the article in the Microsoft Knowledge Base:

182402 OL98: Custom Forms and Programming Limitations


Q: How can I programmatically search for items and folders based on the contents of a field?

A: You cannot programmatically use the Find or Advanced Find features in Outlook, but you can use the Find method in the Outlook object model to retrieve a single item based on the contents of one or more fields. You can also use the Restrict method to retrieve a set of items that match certain criteria. For additional information about how to use the Find and Restrict methods, click the article number below to view the article in the Microsoft Knowledge Base:

181189 OL98: How to Use the Restrict Method


Q: I am having problems working with a collection of objects, what is the cause of this problem?

A: There are three common scenarios that Outlook developers have problems with when they work with collections in the Outlook object model. Because collections, especially the Items collection, are in integral part of the Outlook object model, you should be familiar with these issues. For additional information about how to avoid potential problems when you use collections, click the article number below to view the article in the Microsoft Knowledge Base:

195699 OL98: How to Properly Loop Through Items in a Collection


Q: How can I generate reports based on data that is stored in Outlook?

A: There are a few approaches that you can take:

  • Import the data into another program and use that program's report generating capabilities. Microsoft Access is typically the best program to use because you can use the Link Exchange/Outlook Wizard in Access. However, this wizard does not support user-defined Outlook fields and some of the Outlook standard fields. If you require additional fields that the wizard does not support, you must create custom code to transfer the data from an Outlook folder into an Access table.
  • Create a custom solution in another program that automates Outlook and extracts data from a folder.
  • Use a third-party tool to generate reports. One available utility is Crystal Decisions Crystal Reports. For more information about this utility, view the following Crystal Decisions Web site:http://www.crystaldecisions.net/products/crystalreports/default.asp

Q: What is the best way to create a routing or workflow solution in Outlook?

A: Creating a custom Outlook form solution is typically not the best approach to implement a routing or workflow solution. If you are not familiar with designing custom Outlook forms, implementing this type of solution is often more complex than it appears. For additional information about what to consider if you want to implement a routing solution, click the article number below to view the article in the Microsoft Knowledge Base:

252976 OL2000: Overview of Implementing Workflow or Routing Solutions


Q: How can I integrate address books with my solution?

A: The Outlook object model does not provide a way to display an address book dialog box, but you can access most address book information. If you require more functionality that the Outlook object model provides, the Collaboration Data Objects (CDO) object model most likely provides the functionality that you require. For additional information about how to work with address books in a custom solution, click the article number below to view the article in the Microsoft Knowledge Base:

193457 OL98: Using Address Books in an Outlook Solution


Q: How can I use the SetColumns method?

A: For additional information about using the SetColumns method, click the article number below to view the article in the Microsoft Knowledge Base:

184462 OL98: How to Use the SetColumns Method


Q: When I retrieve appointments and the folder has recurring appointments, the only items retrieved are the initial appointments. Why?

A: You have to set the IncludeRecurrences property of the items collection to true. The default is false, which means that only the original appointment is returned. This is commonly an issue when you use the Find or Restrict methods to return a collection of appointment items. For additional information about this issue, click the article number below to view the article in the Microsoft Knowledge Base:

181190 OL98: How to Retrieve All Recurring Appointments with Code


Q: How can I tell what version of VBScript a computer is using? Where is the documentation for VBScript? Why does Outlook not support Visual Basic for Applications?

A: For additional information about VBScript, click the article number below to view the article in the Microsoft Knowledge Base:

182446 OL98: General Information About Using VBScript with Outlook



Additional query words: FAQ OutSol OutSol98

Keywords: kbinfo kbprogramming KB182349