Click here to Skip to main content
Click here to Skip to main content
Go to top

Developing Outlook 2003 Addin on VSTO SE under Vista + 2007 Office

, 20 Apr 2007
Rate this:
Please Sign up or sign in to vote.
How to compile and debug 2003 VSTO Addins under Vista + 2007 Office

Introduction

If you want to know how to compile and debug VSTO SE Outlook 2003 Addin on a computer with the configuration: Vista+Office 2007, read this article.

Steps

Install Office 2003 PIA and Office 2007 PIA on the same computer

  1. Install Office 2003 in trial mode
  2. Install Office 2003 PIA (we need 1. to install 2003 PIA)
  3. Uninstall Office 2003
  4. Install Office 2007
  5. Create 2003 Addin in Visual Studio project

    Change 2003 COM reference to 2003 PIA in .csproj for "none error" compilation

  6. Open project file in text editor and find this fragment:

    <!--
    This section specifies COM References for the project 
    (managed assemblies that wrap unmanaged typelibs (tlb)). 
    This is the equivalent of choosing "Add Reference->Com Reference" 
    in the IDE.
    -->
    <ItemGroup>
        <COMReference Include="Microsoft.Office.Core">
            <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
            <VersionMajor>2</VersionMajor>
            <VersionMinor>3</VersionMinor>
            <WrapperTool>primary</WrapperTool>
        </COMReference>
        <COMReference Include="Outlook">
            <Guid>{00062FFF-0000-0000-C000-000000000046}</Guid>
            <VersionMajor>9</VersionMajor>
            <VersionMinor>2</VersionMinor>
            <WrapperTool>primary</WrapperTool>
        </COMReference>
        <COMReference Include="stdole">
            <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
            <VersionMajor>2</VersionMajor>
            <VersionMinor>0</VersionMinor>
            <Lcid>0</Lcid>
            <WrapperTool>primary</WrapperTool>
            <Isolated>False</Isolated>
        </COMReference>
    </ItemGroup>
    

  7. Replace found fragment with:

    <!--
    This section specifies COM References for the project 
    (managed assemblies that wrap unmanaged typelibs (tlb)). 
    This is the equivalent of choosing "Add Reference->Com Reference" 
    in the IDE.
    -->
    <ItemGroup>
        <Reference Include="Microsoft.Office.Interop.Outloo<wbr />k, 
            Version=11.0.0.0, Culture=neutral, 
            PublicKeyToken=71e9bce111e9429c" />
        <Reference Include="Office, Version=11.0.0.0, 
            Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <Reference Include="stdole, Version=7.0.3300.0, 
            Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
        <SpecificVersion>False</SpecificVersion>
        </Reference>
    </ItemGroup>
    

  8. Save and now we have a 2003 Addin, which may be compiled under Vista+2007 Office and may be run under 2003 Office.
    Note: Be careful, "do not" set <SpecificVersion>False</SpecificVersion> for Office and Outlook DLL, because if you do it, your Addin will not run under 2003 Office.

    Turn on Debug Capability

  9. Now, all is fine, but you can't debug 2003 Addin under 2007 Office. So for debug capability, in the project file, you need to change code which is in the tag <ProjectExtensions> with fragment code from Outlook 2007 Addin project.

    <!-- 
    This section defines VSTO properties that describe 
    the host-changable project properties. 
    --> 
    <ProjectExtensions> 
      <VisualStudio> 
        <FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}"> 
          <ProjectProperties HostName="Outlook" 
        HostPackage="{D53BAEDE-5B63-42BE-8267-3DED11EDC582}" 
        ApplicationType="Outlook" Language="cs" TemplatesPath="" 
        DebugInfoExeName=
       "#Software\Microsoft\Office\12.0\Outlook\InstallRoot\Path#Outlook.exe" 
        AddItemTemplatesGuid="{147FB6A7-F239-4523-AE65-B6A4E49B361F}" /> 
            <Host Name="Outlook" 
            GeneratedCodeNamespace="OutlookAddIn3" IconIndex="0"> 
            <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" 
            CanonicalName="ThisAddIn" CanActivate="false" 
            IconIndex="1" Blueprint="ThisAddIn.Designer.xml" 
            GeneratedCode="ThisAddIn.Designer.cs" /> 
            </Host> 
        <ProjectClient> 
          <VSTO_CompatibleProducts ErrorProduct=
          "This project requires Microsoft Office Outlook 2007, 
          but this application is not installed." 
          ErrorPIA="This project references the primary interop assembly 
          for Microsoft Office Outlook 2007, but this primary interop 
          assembly is not installed."> 
          <Product Code="{XX12XXXX-XXXX-XXXX-X000-X000000FF1CE}" 
          Feature="OUTLOOKFiles" PIAFeature="Outlook_PIA" /> 
          </VSTO_CompatibleProducts> 
          </ProjectClient> 
        </FlavorProperties> 
      </VisualStudio> 
    </ProjectExtensions>
    

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Paul Dedyul'kin
Web Developer
Russian Federation Russian Federation
Developer

Comments and Discussions

 
QuestionDeveloping Outlook 2003 Addin on VSTO SE under Vista + 2007 Office PinmemberMartin Pacheco27-Nov-09 5:05 
GeneralGlobalAppointmentId Pinmember24891289-Sep-09 22:01 
GeneralFeedback needed: Open-source VSTO add-in to send large files from Outlook released on Codeplex Pinmemberjlchereau2-May-08 9:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 20 Apr 2007
Article Copyright 2007 by Paul Dedyul'kin
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid