none
Having a custom form inside outlook solutions module folder RRS feed

  • Question

  • Hi all,

    Here are a few questions I have -

    1. I have created a custom form region. Can I display it on clicking a folder in my Solutions module ?

    2. I have created an outlook form (based on an in-built type). For example, I design an outlook form "IPM.Contacts.Custom" . Lets say it has a button in addition to the default layout. Is this possible that on clicking a folder on my solutions module, this custom form is displayed on the right ?

    3. After question 2, will the original contacts item still be unaltered? I.E, can we have a custom outlook form based on an inbuilt type, that is independent of and is independently displayed of the inbuilt type?

    Slings and arrows gratefully recieved.

    Thanks



    Monday, May 21, 2012 6:58 AM

Answers

  • no, but you can create generic user control (that is com visible) and in one of its method accept exisitng winform and get all its controls and place it inside itself. Of course this is much more work then actually implement proper user control with controls from the beginning but if you have exisitng winforms app and want to re-use esiting forms then it might be a way to go.
    Monday, May 28, 2012 6:43 AM

All replies

  • question 1 and 2 are based on false assumption - forms, custom forms and regions are displayed for item in folder, not when selecting a folder. If you want to display something for folder, either set its one of Web* related properties (home page, url) or use your code to listen to folder change and dynamically create special item in that folder and display it.

    Question 3 - yes

    Monday, May 21, 2012 7:28 AM
  • So, can the form region be the item itself? or can I base the folder off an inbuilt item (say contacts) and then replace the layout entirely with my form region?
    Monday, May 21, 2012 8:45 AM
  • as far as i remember you can create form regions that will replace everything but not for buil-in message classes, only for custom ones.
    Monday, May 21, 2012 9:02 AM
  • Ok..so if I have created a form region, with message class "IPM.Contacts.Custom", how do I add this to my solutions module?? To add an inbuilt type, I would type

    SolutionContacts = solutionRoot.Folders.Add(
                            "Solution Contacts",
                            Outlook.OlDefaultFolders.olFolderContacts)
                            as Outlook.Folder;

    By the way, its good to know that I can always create a web based form and use it as a workaround. Thanks
    Monday, May 21, 2012 10:36 AM
  • form regions are installed globally - per message class in registry.
    Monday, May 21, 2012 12:27 PM
  • A form region can be registered for a default message class such as "IPM.Note" or "IPM.Contact". See Ryan's original article on form regions: http://msdn.microsoft.com/en-us/library/bb226713(v=office.12).aspx

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "DamianD" <=?utf-8?B?RGFtaWFuRA==?=> wrote in message news:dd74fbbe-b03d-4fab-be4b-7fdfddf413a3...
    form regions are installed globally - per message class in registry.

    Ken Slovak MVP - Outlook
    Monday, May 21, 2012 1:33 PM
    Moderator
  • Yes, but Prashanth Iyer wanted to use replaceAll version, which does not work with buil-in classes, or did mi mixed something up?

    Monday, May 21, 2012 2:00 PM
  • ReplaceAll form regions would only be for derived message classes, such as "IPM.Note.MyForm", not for the base message class. Other types of form regions can be set up for the default message classes.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "DamianD" <=?utf-8?B?RGFtaWFuRA==?=> wrote in message news:bac08cb1-fbc7-433b-9a34-e6292e7758fd...

    Yes, but Prashanth Iyer wanted to use replaceAll version, which does not work with buil-in classes, or did mi mixed something up?


    Ken Slovak MVP - Outlook
    Monday, May 21, 2012 5:38 PM
    Moderator
  • To correct myself, I want to use the seperate version. (but I thought the folder has to be of some inbuilt type) I am new to all this and reading up on registering form regions. Will try everything I can and reply soon. Thanks! 

    I am struggling to find the relationship between 3 things -

    1. Message class that posts a form region which we create, say IPM.Contacts.Custom

    2. The form region   and

    3. A custom folder (on clicking which, I want to show my form region).

    I know that to add a folder programatically to the solutions module, we would use

    SolutionContacts = solutionRoot.Folders.Add(
                            "Solution Contacts",
                            Outlook.OlDefaultFolders.olFolderContacts)
                            as Outlook.Folder;

    but then where do I specify my custom type that pertains to my custom message class? I can't have anything other than olDefaultFolders.olDEFAULTTYPE here..anyhow, will read up a few KBs and be back.  

    Tuesday, May 22, 2012 10:48 AM
  • form regions are not something that will be 'sent' along with message - if reciever of your custom message will not have your add-in installed, your form region will not be shown.

    As for showing something custom per selecting only folder - form region is not the way to achieve something like this.

    And default item for folder can be set using PropertyAccesor, so when user clicks new item button with your folder selected - item with your custom message class will be created.

    Tuesday, May 22, 2012 11:14 AM
  • Ok, to be clear, in my scenario, there are two form regions - one (say formA) which accompanies the inspector (meeting,say) and other (formB) which shows up to the right on clicking a folder. I have no problems with formA. I am having trouble implementing formB.

    I do not intend to send formA or formB with the message. I am just taking taking the data entered in the formA, processing it and the basing the body of the meeting on the data entered. Only the meeting request will be sent.

    [quote]form region is not the way to achieve something like this.[/quote]

     What other ways are there? do you mean using the web properties? I set the

    WebViewOn and WebViewURL properties for my folder, but I still have to go and manually check "Show homepage by default for this folder" , is there a way to programatically set this? (I am trying to do it using PropertyAccesor now)

    I donot want to create a new inspector for form B, I want my form region to be displayed in the reading pane area. Please see this screenshot from here, this is exactly what I want to do:

    http://www.add-in-express.com/creating-addins-blog/wp-upload/images/2010/customized-navigation-pane.png





    Tuesday, May 22, 2012 11:25 AM
  • Wow, thanks. Lot of reading to do.  I am happy to have learnt about FolderHomePage

    class.

    P.S I am unable to covert the sample and open the project in VS 2010 or 2008. Do I have to open it only through 2005? I get the below errors:

    Error 4 Cannot find outputs of project output group '(unable to determine name)'.  Either the group, its configuration, or its project may have been removed from the solution. D:\Program Files\Microsoft\Outlook.CRMIntegration Setup\Outlook.CRMIntegration Setup.vdproj Outlook.CRMIntegration Setup

    Error 1 The type or namespace name 'Tools' does not exist in the namespace 'Microsoft.Office' (are you missing an assembly reference?) D:\Program Files\Microsoft\backup\Backup\Outlook.Utility\Toolbar\CommandBarManager.cs 19 45 Outlook.Utility

    Wednesday, May 23, 2012 8:55 AM
  • error 1 - this si setup project, you do not need it to run from VS and debug, simply remove it

    error 2 - i guess this is due to interop assemblies that are required for project - either manually convert that code to use ribbon with your hand rolled replacement code for placing buttons or drop there proper interop assemblies and reference them

    Wednesday, May 23, 2012 9:10 AM
  • Really sorry to trouble you with small errors -

    I fixed errors 1 and 2, but then

    Error 4 The type or namespace name 'Application' does not exist in the namespace 'Microsoft.Office.Tools.Outlook' (are you missing an assembly reference?) D:\Program Files\Microsoft\CRM Integration Add-in Sample for Microsoft Outlook Source\Outlook.Utility\CustomItemManager.cs 21 59 Outlook.Utility

    I don't understand what dll to reference to solve this problem. It shows up in the line

    public CustomItemManager(Microsoft.Office.Tools.Outlook.Application app)
    			: this(app.Inspectors.Application)
    		{
    		}

    Error 2 Metadata file 'D:\Program Files\Microsoft\CRM Integration Add-in Sample for Microsoft Outlook Source\Outlook.Utility\bin\Debug\Microsoft.Sample.Outlook.Utility.dll' could not be found Outlook.CRMIntegration

    Please help. Thanks.



    Thursday, May 24, 2012 10:09 AM
  • in new interop assemblies Application class is located in namespace Microsoft.Office.Interop.Outlook
    Thursday, May 24, 2012 10:37 AM
  • I changed the function from

    public CustomItemManager(Microsoft.Office.Tools.Outlook.Application app)
    to 

    public CustomItemManager(Microsoft.Office.Interop.Outlook.Application app)

    but there is already a function with this same signature, commenting either of them is resulting in a lot more errors. So, I appended the body of one to the other and removed the other. Now, I have 12 errors. It looks like a lot to fix. Am I doing something wrong or would it be easier to just get VS2005 and run the code?

    what am I doing wrong?



    Thursday, May 24, 2012 1:48 PM
  • Microsoft.Office.Interop.Outlook is the PIA for Outlook. It has nothing to do with VSTO. It is needed to be able to work with the Outlook object model.
     
    Microsoft.Office.Tools is one of the PIA's that are related to VSTO. It has nothing to do specifically with Outlook. It's used also for Word, for example. It provides VSTO functionality.
     
    When you get the startup event you can assign an instance of Outlook.Application from this.Application in c# or Me.Application in VB.NET. That will give you the Outlook.Application object passed by VSTO, which is a trusted Application object that won't fire the security prompts.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Prashanth Iyer" <=?utf-8?B?UHJhc2hhbnRoIEl5ZXI=?=> wrote in message news:b325ccba-7e22-444f-a813-3b3cc4730114...

    I included Microsoft.Office.Interop.Outlook, it does not have Microsoft.Office.Tools.Outlook.Application

    It gives the error :

    The type or namespace name 'Tools' does not exist in the namespace 'Microsoft.Office' (are you missing an assembly reference?)

    So then I included Microsoft.Office.Tools and it gives :

    The type or namespace name 'Application' does not exist in the namespace 'Microsoft.Office.Tools.Outlook' (are you missing an assembly reference?)

    what am I doing wrong?


    Ken Slovak MVP - Outlook
    Thursday, May 24, 2012 2:02 PM
    Moderator
  • Damian, is it possible to have a folder item display a winForm ( or Formregion) without it being hosted in html ?
    Monday, May 28, 2012 5:04 AM
  • no, but you can create generic user control (that is com visible) and in one of its method accept exisitng winform and get all its controls and place it inside itself. Of course this is much more work then actually implement proper user control with controls from the beginning but if you have exisitng winforms app and want to re-use esiting forms then it might be a way to go.
    Monday, May 28, 2012 6:43 AM