locked
embed a C# form in outlook(2003) Mail and send RRS feed

  • Question

  • i am developing an add-in for outlook(2003) using VS2008(C#).

    i have designed a form in this add-in (by using the Add-NewItem wizard and selecting windows form).
    now i want to send this form along with an outlook email.

    to be very clear: "i want this form to be sent as part of the body of the outlook mail and this form should be active on the client system.. i.e., if the user clicks on a button (on this form) an action (associated with the click event on this button) should be performed".

    Pleae help me on this...

    Wednesday, February 17, 2010 1:29 PM

Answers

  • Hello,

    Sorry for delay. As far as I see, Outlook 2003 Object Model does expose such a method to achieve this goal. As Ji said in this thread, Outlook 2007 is the first version to support using managed code to custom Outlook Form Region. In Outlook 2003, we could create a form region by UI. Then in Outlook 2007 Add-In, we could import this form region and write some lines for this button. For this method, please refer to this MSDN page: http://msdn.microsoft.com/en-us/library/aa942741(VS.80).aspx

    <<i have designed a form in this add-in (by using the Add-NewItem wizard and selecting windows form).>>
    As far as I know, by using VSTO technology in Outlook 2003, we could not attach a windows form to a mail item.

    If you have any concern for this, please feel free to follow up.

    Best regards,
    Bessie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Bessie Zhao Wednesday, February 24, 2010 10:37 AM
    Monday, February 22, 2010 3:08 AM

All replies

  • Hello,

    Sorry for delay. As far as I see, Outlook 2003 Object Model does expose such a method to achieve this goal. As Ji said in this thread, Outlook 2007 is the first version to support using managed code to custom Outlook Form Region. In Outlook 2003, we could create a form region by UI. Then in Outlook 2007 Add-In, we could import this form region and write some lines for this button. For this method, please refer to this MSDN page: http://msdn.microsoft.com/en-us/library/aa942741(VS.80).aspx

    <<i have designed a form in this add-in (by using the Add-NewItem wizard and selecting windows form).>>
    As far as I know, by using VSTO technology in Outlook 2003, we could not attach a windows form to a mail item.

    If you have any concern for this, please feel free to follow up.

    Best regards,
    Bessie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Bessie Zhao Wednesday, February 24, 2010 10:37 AM
    Monday, February 22, 2010 3:08 AM
  • Sir... Thanks for your kind reply,

    Ur UseFull Tip:"as you mentioned that we could not attach a windows form to a mailItem. So I used MessageClass property to make a new item opened as this custom form...", and I have successfully did what i wanted to do...

    thanks.
        
    My Question: am sending a mail through C# by setting the MessageClass property to a custom form class, and in that custom form (which is designed in Outlook[2003] using the Tools|DesignForm wizard) i have written VBA script to handle some tasks Via "Two custom Buttons".
        now my problem is.. "I want to restrict the user to click one of the two buttons on that custom form. i.e., the user must click either of the two buttons before closing that mail item"

        I have two logical solutions for this...
    1) I want to disable the default close (X) button on the top right corner of the inspector.
            --OR--
    2) I can catch the Inspector.Close() Event  or catch the Item.Close() event and in this event handler i will check whether the user has clicked one of two buttons.

    but i dont know how to do this. plz tell me how to disable that default close (X) button through C#..... 

    and in C# the properties dialog box (which will be displayed as soon as you put a dot after an object) does not shows the Inspector.Close event and also not showing the Item.Close Event... why...?   (but this dialog box shows Inspector.Close() Method and Item.Close Method)


    Warm Regards
    Md.A.RaheeM

    Friday, February 26, 2010 9:31 AM