How to Create an Outlook Plugin using Delphi?

前端 未结 5 522
日久生厌
日久生厌 2021-02-08 14:14

I\'m working on a database project and I need to create Outlook 2007 plugin that saves the current previewed message into my database.

Can someone give me a step-by-step

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-08 14:52

    I've built an outlook add-in using Delphi (integrating a room reservation system into the appointment form).

    Some advice:

    • Buy and use add-in express. It will save you a lot of time, and it allows you to build COM add-ins that don't require any third-party components at installation time. We tried building our own component first, and although we managed to put buttons on forms that did something, the amount of time spent was disproportionate to the result.
    • Use the add-in express support service when in doubt. They know their stuff.
    • The COM interface for outlook (found in the delphi/ocx/servers/ folder) is your friend. Add-In Express merely provides a (much) more convenient wrapper around this functionality.

    Things to avoid:

    • Straight MAPI calls. It can be done, and in fact I had to resort to it for modifying message streams in transit, but it's a real PITA to work with and very poorly documented.
    • One-off forms. We wasted a lot of time trying to get one-off forms to work. Only use published forms. You can publish a form to the local folder from code, so in practice this is not a big deal. Even better is to use form regions, which is the most robust way of extending forms.
    • Pretending like COM in Delphi is anything like normal VCL programming. My advice if you don't have COM experience is to read any and all documentation you can get your hands on. Some hard-learned lessons were to always set variables to nil before the end of a function so objects could get freed correctly by outlook, and to always request the appropriate interface from an object instead of trying to cast it.

提交回复
热议问题