Partilhar via


<addin> Element (Office Development in Visual Studio)

The addin element of the vstav3 namespace contains information that is specific to Microsoft Office application-level add-ins and document-level customizations developed with Visual Studio.

<addIn>
  <entryPointsCollection>
    <entryPoints>
      <entryPoint>
      </entryPoint>
    </entryPoints>
  </entryPointsCollection>
  <update></update>
  <postActions>
    <postAction>
      <postActionData>
      </postActionData>
    <postAction>
  </postActions>
  <application>
    <customization>
    </customization>
  </application
</addIn>

Elements and Attributes

The addin element of the vstav3 namespace contains information about the Office solution and the Microsoft Office application. This element must be in the following namespace: vstav3=urn:schemas-microsoft-com:vsta.v3. Child elements must also be in this namespace.

The addin element has no attributes.

The addin element has the following child elements.

entryPoints

Required. The entryPoints element is described in <entryPoints> Element (Office Development in Visual Studio).

update

Required. The update element is described in <update> Element (Office Development in Visual Studio).

postActions

Optional. The postActions element is described in <postActions> Element (Office Development in Visual Studio).

application

Required. The application element is described in <application> Element (Office Development in Visual Studio).

Document-Level Customization Example

Description

The following code example illustrates the addin element in a document-level Office solution that is deployed by using ClickOnce. This code example is part of a larger example provided in Application Manifests for Office Solutions.

Code

<vstav3:addIn 
  xmlns:vstav3="urn:schemas-microsoft-com:vsta.v3">
  <vstav3:entryPointsCollection>
    <vstav3:entryPoints>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.ThisWorkbook">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.Sheet1">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.Sheet2">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
      <vstav3:entryPoint 
        class="ContosoExcelWorkbook.Sheet3">
        <assemblyIdentity 
          name="ContosoExcelWorkbook" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
    </vstav3:entryPoints>
  </vstav3:entryPointsCollection>
  <vstav3:update 
    enabled="true">
    <vstav3:expiration 
      maximumAge="7" 
      unit="days" />
  </vstav3:update>
  <vstav3:application>
    <vstov4:customizations 
      xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
      <vstov4:customization>
        <vstov4:document 
          solutionId="73e" />
      </vstov4:customization>
    </vstov4:customizations>
  </vstav3:application>
</vstav3:addIn>

Application-Level Add-in Example

Description

The following code example illustrates the addin element in an application-level Office solution that is deployed by using ClickOnce. This code example is part of a larger example provided in Application Manifests for Office Solutions.

Code

<vstav3:addIn 
  xmlns:vstav3="urn:schemas-microsoft-com:vsta.v3">
  <vstav3:entryPointsCollection>
    <vstav3:entryPoints>
      <vstav3:entryPoint 
        class="ContosoOutlookAddIn.ThisAddIn">
        <assemblyIdentity 
          name="ContosoOutlookAddIn" 
          version="1.0.0.0" 
          language="neutral" 
          processorArchitecture="msil" />
      </vstav3:entryPoint>
    </vstav3:entryPoints>
  </vstav3:entryPointsCollection>
  <vstav3:update 
    enabled="true">
    <vstav3:expiration 
      maximumAge="7" 
      unit="days" />
  </vstav3:update>
  <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 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>
</vstav3:addIn>

See Also

Reference

Application Manifests for Office Solutions

Deployment Manifests for Office Solutions

ClickOnce Application Manifest