none
Form Region does not load RRS feed

  • Question

  • I am developing an Outlook add-in using VS 2010, .NET 4.0, VSTO 4.0.  The project has an adjoining form region.  I am using Windows Installer to deploy the application.  The application is for Outlook 2007 and higher.  The development machine has 2007, and a test machine has 2010.

    When I first created the application, it ran fine in debug mode (ie, the form region displayed and functioned properly), but when deployed to the test machine the form region did not show up.  After studying numerous walkthroughs and blogs on the subject, I modified the program per this blog:

    http://blogs.msdn.com/b/andreww/archive/2006/11/24/getformregionicon-and-getformregionmanifest.aspx 

    And this walkthrough:

    http://msdn.microsoft.com/en-us/library/aa942741(VS.80).aspx 

    Now not only does the form region not show up on the test machine, it does not show up on the development machine either in debug or installed.  The ribbon in the project, by the way, shows up just fine.

    I have tried pointing to the manifest both by application name and by file path.  It does not seem to matter.  The code runs, there are no errors, but no form region. 

     


    Steve Jensen
    Sunday, March 27, 2011 7:49 PM

Answers

  • Thank you for the help on this, but I found the problem: 

    In HKCU\Software\Microsoft\Office\Outlook\Addins the addin key name was 'MyCompany.MyProject'.  I changed it to 'MyProject' (the internal name of the project) and now I see the form region.

    Too simple....

    I have read many articles, blog posts, and forum threads about publishing Outlook form regions with and without ClickOnce.  It gets a bit overwhelming, especially since most of it appears to be written around VSTO 3.0 and VS 2005, and one gets the impression you still need to do all those things in those articles.

    The article by Ryan Gregg http://msdn.microsoft.com/en-us/library/bb226713(office.12).aspx/ (the section near the bottom called Creating a Setup Project) was very helpful.  Even though written for VS 2005 the steps are still OK in VS 2010.  However, there were some changes under 'How to register the form region and the add-in':

    1.  His example created a form region as a separate project, whereas my form region was added to the existing addin project.  Therefore my reference to the FormRegion in the registry was 'MyProject.Region1' rather than 'MyProject'.

    2.  His example uses a file system path to a manifest file.  I used a reference to the project instead ("=MyProject"). 

    3.  Despite articles that say you have to create a manifest and  invoke the LoadFormRegionManifest method if you do this, the form region loaded without going through those steps.  In other words, I did not need to create a separate manifest, or an osf, as the definition of the form region appears to be in the project manifest.

     


    Steve Jensen
    • Marked as answer by Steve Jensen Tuesday, March 29, 2011 12:37 AM
    • Edited by Steve Jensen Tuesday, March 29, 2011 3:49 AM clarification
    Tuesday, March 29, 2011 12:37 AM

All replies

  • Hello Steve,

    Thanks for posting. For this issue, I think we also need to add form region registry entries like ones in development machine. Have you tried these steps on the client machine? For more information, please see the part "Creating a Setup Project" in this MSDN page: http://msdn.microsoft.com/en-us/library/bb226713(office.12).aspx/.

    Actually, we also could import the form region (.ofs) file into an Outlook add-in. Please refer to this article: http://msdn.microsoft.com/en-us/library/bb608611.aspx.

    If this post does not help you, just feel free to follow up. Have a nice day.


    Bessie Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 28, 2011 6:56 AM
  • I did not use the form designer in Outlook for this project.  I created the form region in VS by adding it to the project as a new item.   As for the registry entries, they have been created on the client machine.

    I have tried referring to the form region by the project internal name as well as a file path to the manifest:

    1.  HKCU\Software\Microsoft\Office\Outlook\FormRegions\IPM.Appointment\MyProject.Region1= "c:\users\user1\appdata\roaming.....\region1.xml"  (I also tried the project manifest "myproject.dll.manifest")

    2.  HKCU\Software\Microsoft\Office\Outlook\FormRegions\IPM.Appointment\MyProject.Region1= "=Myproject"

    On the development machine the registry key is #2.

    If I remove the code below in ThisAddIn.vb, the form region displays properly in debug mode on the development machine:

     Protected Overrides Function RequestService(ByVal serviceGuid As Guid) As Object
            If serviceGuid = GetType(Microsoft.Office.Interop.Outlook.FormRegionStartup).GUID Then
                Return New FormRegionHookup()
            Else
                Return MyBase.RequestService(serviceGuid)
            End If

        End Function 'RequestService

    However, it does not display on the test machine.

     

     

     


    Steve Jensen
    Monday, March 28, 2011 5:18 PM
  • Thank you for the help on this, but I found the problem: 

    In HKCU\Software\Microsoft\Office\Outlook\Addins the addin key name was 'MyCompany.MyProject'.  I changed it to 'MyProject' (the internal name of the project) and now I see the form region.

    Too simple....

    I have read many articles, blog posts, and forum threads about publishing Outlook form regions with and without ClickOnce.  It gets a bit overwhelming, especially since most of it appears to be written around VSTO 3.0 and VS 2005, and one gets the impression you still need to do all those things in those articles.

    The article by Ryan Gregg http://msdn.microsoft.com/en-us/library/bb226713(office.12).aspx/ (the section near the bottom called Creating a Setup Project) was very helpful.  Even though written for VS 2005 the steps are still OK in VS 2010.  However, there were some changes under 'How to register the form region and the add-in':

    1.  His example created a form region as a separate project, whereas my form region was added to the existing addin project.  Therefore my reference to the FormRegion in the registry was 'MyProject.Region1' rather than 'MyProject'.

    2.  His example uses a file system path to a manifest file.  I used a reference to the project instead ("=MyProject"). 

    3.  Despite articles that say you have to create a manifest and  invoke the LoadFormRegionManifest method if you do this, the form region loaded without going through those steps.  In other words, I did not need to create a separate manifest, or an osf, as the definition of the form region appears to be in the project manifest.

     


    Steve Jensen
    • Marked as answer by Steve Jensen Tuesday, March 29, 2011 12:37 AM
    • Edited by Steve Jensen Tuesday, March 29, 2011 3:49 AM clarification
    Tuesday, March 29, 2011 12:37 AM