<customization> 元素(Visual Studio 中的 Office 开发)

vstov4 命名空间的 customization 元素描述特定 Office 解决方案。对于文档级自定义项和应用程序级外接程序,子元素是不同的。

文档级自定义项的语法

<customization
  id
  <document
    solutionId
  />
</customization>

应用程序级外接程序的语法

<customization
  id
  <appAddin
    application
    loadBehavior
    keyName>
  <friendlyName></friendlyName>
  <description></description>
  <formRegions></formRegions>
</customization>

元素和特性

customization 元素包含特定于自定义项的信息。此元素必须在以下命名空间中:vstov4=urn:schemas-microsoft-com:vsto.v4。每个 Office 解决方案都有一个 customization 元素。例如,如果您在一个多项目部署中部署三个 Office 解决方案,则应用程序清单中有三个 customization 元素。

程序集的子元素也必须在此命名空间中。

customization 元素具有以下特性。

特性

说明

id

对于多项目部署是必需的。id 元素唯一地标识 Office 解决方案。

Bb757445.collapse_all(zh-cn,VS.110).gif文档级自定义项

customization 元素具有以下子元素。

Bb757445.collapse_all(zh-cn,VS.110).gifdocument

vstov4 命名空间中的 document 元素是在 <document> 元素(Visual Studio 中的 Office 开发)中定义的。

Bb757445.collapse_all(zh-cn,VS.110).gif应用程序级外接程序

customization 元素具有以下子元素。

Bb757445.collapse_all(zh-cn,VS.110).gifappAddin

vstov4 命名空间中的 appAddin 元素是在 <appAddin> 元素(Visual Studio 中的 Office 开发)中定义的。

文档级自定义项示例

Bb757445.collapse_all(zh-cn,VS.110).gif说明

下面的代码示例演示文档级自定义项的 customization 元素。此代码示例摘自 Office 解决方案的应用程序清单中提供的一个更大的示例。

Bb757445.collapse_all(zh-cn,VS.110).gif代码

      <vstov4:customization>
        <vstov4:document 
          solutionId="73e" />
      </vstov4:customization>

应用程序级外接程序示例

Bb757445.collapse_all(zh-cn,VS.110).gif说明

下面的代码示例演示应用程序级外接程序的 customization 元素。这是一个包含窗体区域的 Outlook 外接程序。此代码示例摘自 Office 解决方案的应用程序清单中提供的一个更大的示例。

Bb757445.collapse_all(zh-cn,VS.110).gif代码

      <vstov4:customization>
        <vstov4:appAddIn 
          application="Outlook" 
          loadBehavior="3" 
          keyName="ContosoOutlookAddIn">
          <vstov4:friendlyName>
            ContosoOutlookAddIn
          </vstov4:friendlyName>
          <vstov4:description>
            ContosoOutlookAddIn - Outlook add-in 
            created with Visual Studio Tools for Office
          </vstov4:description>
          <vstov4:formRegions>
            <vstov4:formRegion
                name="OutlookAddIn1.FormRegion1">
              <vstov4:messageClass name="IPM.Note" />
              <vstov4:messageClass name="IPM.Contact" />
              <vstov4:messageClass name="IPM.Appointment" />
            </vstov4:formRegion>
          </vstov4:formRegions>
        </vstov4:appAddIn>
      </vstov4:customization>

请参见

参考

Office 解决方案的应用程序清单

Office 解决方案的部署清单

ClickOnce 应用程序清单