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

vstov4 命名空间的 customizations 元素包含关于安装和加载每个 Office 解决方案的所有信息。

文档级自定义项的语法

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

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

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

元素和特性

customizations 元素包含有关每个 Office 解决方案的特定信息。此元素必须在以下命名空间中:vstov4=urn:schemas-microsoft-com:vsto.v4。程序集的子元素也必须在此命名空间中。

customizations 元素没有特性。

customizations 元素具有以下子元素。

Dd465308.collapse_all(zh-cn,VS.110).gifcustomization

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

文档级自定义项示例

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

下面的代码示例演示文档级自定义项的 customizations 元素。

说明说明

此代码示例摘自 Office 解决方案的应用程序清单中提供的一个更大的示例。

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

    <vstov4:customizations 
      xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
      <vstov4:customization>
        <vstov4:document 
          solutionId="73e" />
      </vstov4:customization>
    </vstov4:customizations>

应用程序级外接程序示例

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

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

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

    <vstov4:customizations 
      xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
      <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>
    </vstov4:customizations>

请参见

参考

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

Office 解决方案的部署清单

ClickOnce 应用程序清单