Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Apr 2004
    Location
    Merrimack, New Hampshire, USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Programmatic access to Outlook, is it possible? (2002)

    I'd like to be able to treat mail messages as data records and pull specific user specified or selected messages into other OLE compliant applications.
    For example, I have an app that logs the way we process returned goods (RGA). Customers often communicate with us via email. I'd like to sit in the RGA app and allow users to pull in email messages related to a specific returned item. I need to be able to capture, as part of this email 'linking' operation as much of the email record as I can grab - subject, who it was sent to (send to, cc), the body of the message, delivery header data, and any other meta data that is available.

    A simple select all/copy/paste of the message just grabs the message body and I need the meta data also.

    Is this possible or am I dreaming?

    Thanks for any infomation.

    Dogu.

    more details if you care.
    The app is Lotus Notes based. We used to use Notes for mail so this operation was trivial since Notes mail is just another db and mail messages are just db records.
    I can use OLE in Notes to send data TO Outlook (mail, calendar entries, tasks, whatever - pretty easy).
    I've searched forums for Notes, MS, and here for code to run the other way - no joy.
    If one can sit in Outlook and push a message (and it's meta data) to Notes, that's cool too as long as there's a way for me to distrubute said code to my user base.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Programmatic access to Outlook, is it possible? (2002)

    You aks a very broad question. Outlook's object model is not as exposed under VBA as Word, Excel or Access, so there are limits, but the general answer is 'yes'. In Outlook a message is a 'MailItem' object ; if you search this Forum for 'MailItem', 'Recipient', 'Body' and some other key MailItem Properties you'll see some examples. However, the message metadata such as internet headers is not directly exposed under VBA. To complicate things, there are other ways to get at Outlook data, including CDO and the 3rd party Redemption library; which expose more objects. When coding Outlook, you must also be cognizant that it contains a number of security walls intended to manage viruses which attempt to use Outlook data. To get started, search this forum for code examples, ask more detailed questions here, and you can also look through http://www.outlookcode.com. There are also some other resources noted in <!post=this post,306541>this post<!/post>.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    New Lounger
    Join Date
    Apr 2004
    Location
    Merrimack, New Hampshire, USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Programmatic access to Outlook, is it possible? (2002)

    John,

    Thank you for the pointers. I'll give them a look.

    Third party tools aren't an option.

    If the 'guts' of the message are not exposed to VBA or similar OLE languages, then I doubt if I'll be able to do much.

    As a workaround, we have discovered we can save messages as files (which include all the meta data and attachments) and can use these within our Notes applications.

    Doug

    More info in case you're interested.

    In Notes, mail is just a db record that can be moved into any other Notes app. If we are tracking returned goods and get a message from a customer, we can simply copy the mail document as an intact database record into the app used to manage returned goods - simple and clean with a robust legal document trail.

    I want to mimic this feature, but treate Outlook mail as database records. In order to do this, I have to have visibility to all of the mail properties and have some method to create a Notes like clone of the Outlook mail message. It's a bit of a stretch, but how would you convert an Outlook mail message, all attachments, and meta data into an Access db record? That's what I'm trying to do.

    Like I said, the 'msg' file seems to be a reasonable workaround and I'll dig through the forum for the properties you describe.

    Thanks again for the pointers.

    Dogu

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Programmatic access to Outlook, is it possible? (2002)

    Access can import data from Outlook and Exchange through File | Get External Data | Import...

    A simple example of doing this programmaticaly can be found in MSKB article OL2002: How to Programmatically Export Outlook Items to Microsoft Access.

    More sophisticated examples of how to use code to transfer data between Access and Outlook can be found on Helen Feddema's website.

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Programmatic access to Outlook, is it possible? (2002)

    I didn't realize that you wanted to accomplish your goals through Access. For import ing Exchange and Outlook data to Access, see <!post=this VBA post,261471>this VBA post<!/post>. There may not be adequate data in this capability for your needs, but from what you are specifying the VBA Forum is probably a better location to pursue you questions.

    From what little I understand Outlook keeps data much more client-side oriented than Notes, and provides client-side end-user rules and Categories for organizating messages and other items. You may be able to accomplish your ends if you start using Categories, etc., entity-wide, and managing the data that way. I only know the client side of Outlook, there is also a Server Forum where experts may be able to help you.
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Programmatic access to Outlook, is it possible? (2002)

    > simple and clean with a robust legal document trail

    Although it's a file-system oriented solution, how about printing the messages to PDF files, assuming you can find a way to do this in code? Those are far more difficult to edit than .MSG files. Of course, you won't see the full headers this way. There's always a catch. <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •