Compartilhar via


Specifying Form Regions in the Windows Registry

To run a form that contains a form region on a client computer, you must register the form region in the Windows registry, specifying the message class and other information necessary for Microsoft Outlook to display the form region. This information includes the display name, where the form region appears in a form, any layout file or add-in that implements the form region, any supported user actions, and any localized terms for the user interface. The structure of this information follows a form region XML schema; for more information on the XML schema for form regions, see the Microsoft Outlook 2010 XML Schema Reference in the MSDN Library.

There are a few ways to specify this information about the form region in the registry. You can explicitly specify the XML, or a full path to an XML file, that contains this information for the form region and that conforms to the form region XML schema. You can also choose to specify the ProgID of an add-in which will provide Outlook the XML manifest for the form region. When Outlook starts, it reads the list of form regions from the registry and caches the associated data.

Cuidado A edição incorreta do registro do Windows pode danificar severamente seu sistema. Antes de fazer quaisquer alterações no Registro, convém fazer backup de todos os dados valiosos do computador.

Registrando uma área de formulário

Registrar regiões de formulário sob a chave FormRegions no registro do Windows, na chave do computador local (como HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\FormRegions) ou na chave de usuário atual (como HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\FormRegions). Under the FormRegions key, create a separate key for each message class for which form regions have been created. For example, the mail item has the message class IPM.Note; you can register all form regions used to display the mail item for the current user under the key, HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\FormRegions\IPM.Note.

The following steps show how to register a form region under the local machine:

  1. Close Outlook.
  2. Add the following key to the registry if it does not already exist: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\FormRegions.
  3. Under the FormRegions key, add a key with the name of the message class that the form region is associated with, if that key does not already exist. For example, to create a form region for the contact item, add a key with the name IPM.Contact, if it does not already exist.
  4. For that key, add a value of the type REG_SZ, and specify the name to be the same as the name element of the form region. This is the internal name for the form region; the internal name supports only ASCII characters. Specify the data as one of the following possible values:
    • Explicitly the XML that specifies the layout, behavior, and other characteristics for the form region, and that conforms to the form region XML schema. Nesse caso, você deve preceder os dados com um sinal de menor que ( <).
    • The ProgID of an add-in that will provide Outlook the XML manifest for the form region. Nesse caso, você deve preceder os dados com um sinal de igual ( =). For example, if the ProgID of an add-in is MyAddinProject1.ConnectClass, you would specify the data of the key to be =MyAddinProject1.ConnectClass.
    • The full local file path name to a form region XML manifest file that describes the layout, behavior, and other characteristics of the form region. Se os dados não forem precedidos com um sinal de menor que ( <) ou um sinal de igual ( =) e, em seguida, o Outlook vai considerar que os dados são um nome de caminho para o arquivo XML de manifesto da região do formulário. Por exemplo, se o arquivo de manifesto XML da região do formulário, map.xml, estiver em c:\Regiões de Formulário, você especificaria os dados da chave a ser c:\Form Regions\map.xml.

Especificando áreas de formulário como substituições para formulários padrão

Outlook allows you to customize the standard form for each of the Outlook message classes by adding adjoining form regions or separate form regions to the form. A tabela a seguir mostra os formulários padrão e as classes de mensagens correspondentes no Outlook.

Formulário padrão Classe de mensagem
Compromisso IPM. Nomeação
Contact IPM. Contato
Entrada de Diário IPM. Atividade
Solicitação de Reunião IPM. Meeting.Schedule.Request
Mensagem IPM. Nota
Postagem IPM.Post
Tarefa IPM. Solicitação
Solicitação de Tarefa IPM. Tarefa

Nota Você não pode especificar regiões de formulário para a classe de mensagem raiz do Outlook, IPM.

You can add separate form regions as extra pages to a standard form, but you cannot replace any existing pages on the standard form and keep the form for the same Outlook message class. Se você precisar substituir a página padrão ou todas as páginas de um formulário padrão, precisará derivar uma nova classe de mensagem para esse formulário, especificar uma região de formulário de substituição para substituir a página padrão ou uma região de formulário de substituição para substituir todo o formulário e registrar essa região de formulário para a classe de mensagem derivada.

For example, you can create a replacement form region that replaces the General page of the Contact form, and register that form region for a message class derived from IPM.Contact, such as IPM.Contact.MyContact. You cannot register the form region for the IPM.Contact message class.

Quando o Outlook abre um item e vê uma classe de mensagem derivada (por exemplo, IPM. Contact.MyContact.Personal.Family), ele procura uma região de formulário de substituição ou substituição de todos (ou seja, uma região de formulário que tem um elemento formRegionType sendo igual a substituir ou substituirAll) e que corresponde exatamente à classe de mensagem derivada, IPM. Contact.MyContact.Personal.Family. If there is no exact match, Outlook will try IPM.Contact.MyContact.Personal, and if that fails, Outlook will try IPM.Contact.MyContact. Note that Outlook ignores any replacement or replace-all form regions for IPM.Contact. If there is not yet an exact match, Outlook will look for any form region with formRegionType equal to adjoining or separate for the derived class, IPM.Contact.MyContact.Personal.Family.

Várias áreas de formulário para a mesma classe de mensagens

When one or more add-ins registers multiple form regions for the same message class, the display order of adjoining form regions on the default page and the order of separate form regions in the form depends on the order that the add-ins are installed and the order that the add-ins register the form regions. If an add-in specifies more than one adjoining form region or more than one separate form region for a message class, the add-in can use the displayAfter element to specify the order of these form regions. The order specified by displayAfter takes precedence over the order of the form regions in the registry. This is the only means add-ins can specify the order of form regions in a form.

Depois que as áreas de formulário forem instaladas em um computador cliente, os usuários do formulário poderão personalizar a ordem das áreas de formulário adjacentes, abrindo o formulário e movendo as áreas de formulário para cima ou para baixo na página padrão por meio do menu de contexto do cabeçalho da área de formulário.

Exemplo

The following is an example of the XML for a form region for a derived message class, IPM.Contact.MapUser. The form region is applied to all users on a computer. The XML file, map.xml, is located in c:\Form Regions.

Para registrar a região do formulário, crie o seguinte valor no registro do Windows:

Valor do Registro Entrada
Chave HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\FormRegions\IPM.Contact.MapUser
Nome MapTab
Tipo REG_SZ
Dados c:\Form Regions\map.xml

The following lists the content of map.xml:

<?xml version="1.0"?> 
<FormRegion xmlns="https://schemas.microsoft.com/office/outlook/12/formregion.xsd">   
    <!-- Internal name --> 
    <name>MapTab</name> 
    <!-- Display name --> 
    <title>Directions</title> 
    <!--  Additive separate form region --> 
    <formRegionType>separate</formRegionType> 
    <!--  Layout file --> 
    <layoutFile>Map.ofs</layoutFile> 
    <!-- Icon for form region in all contexts --> 
    <icons> 
        <default>generic.ico</default> 
    </icons> 
</FormRegion> 

The form region is added to the form as a page following the last non-hidden built-in page in the Contact form (normally, this would follow the All Fields page). The page is titled Directions and has an internal programmatic name "MapTab". Map.xml specifies a layout file and an icon file. Note that all file paths in the xml file can be specified as full file paths, or paths relative to the location of the form region XML manifest file.

Suporte e comentários

Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.