<>在 Visual Studio) 中 (Office 程式開發的應用程式元素<application> element (Office development in Visual Studio)

application 命名空間的 vstav3 項目會包裝 Office 方案的描述。The application element of the vstav3 namespace wraps the description of Office solutions. 文件層級自訂與 VSTO 增益集的子項目不同。The child elements are different for document-level customizations and VSTO Add-ins.

檔層級自訂的語法Syntax for document-level customizations

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

應用層級增益集的語法Syntax for application-level add-ins

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

元素和屬性Elements and attributes

application 命名空間的 vstav3 項目是包裝 vstov4 命名空間所包含之所有自訂特定資訊的節點。The application element of the vstav3 namespace is the node that wraps all the customization-specific information that is contained in the vstov4 namespace.

application 項目沒有任何屬性。The application element has no attributes.

application 項目具有下列項目。The application element has the following element.

自訂Customization

customization命名空間中專案的角色 vstov3 會定義在<自訂> 專案中,(Visual Studio)中的 Office 程式開發The role of the customization element in the vstov3 namespace is defined in <customization> Element (Office Development in Visual Studio).

檔層級自訂範例Document-level customization example

描述Description

下列程式碼範例說明使用 application 部署之文件層級 Office 方案中的 ClickOnceClickOnce項目。The following code example illustrates an application element in a document-level Office solution deployed using ClickOnceClickOnce. 這個程式碼範例是 Application Manifests for Office Solutions中所提供之較大範例的一部分。This code example is part of a larger example provided in Application Manifests for Office Solutions.

程式碼Code

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

VSTO 增益集範例VSTO Add-in example

描述Description

下列程式碼範例說明使用 application 部署之應用程式層級 Office 方案中的 ClickOnceClickOnce項目。The following code example illustrates an application element in an application-level Office solution deployed using ClickOnceClickOnce. 這個程式碼範例是 Application Manifests for Office Solutions中所提供之較大範例的一部分。This code example is part of a larger example provided in Application Manifests for Office Solutions.

程式碼Code

<vstav3:application>
  <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 VSTO 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>
</vstav3:application>

另請參閱See also