Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Accessing mailitem.to property via VBA (2002)

    I'm investigating writing my own home grown spam filter using Outlook VBA. One problem I immediately encountered was that, when I tried to retrieve the mailitem.to property for the latest item I received, I got a message saying "A program is trying to access email addresses you have stored in Outlook. Do you want to allow this?" Is there a way for me to allow only my program to get access to these addresses?

    Another related question is: if I try to access the mailitem.body property, will that actually open the message (in such a way that (a) the sender knows it's been opened, and ([img]/forums/images/smilies/cool.gif[/img] if contains a virus it might get launched)?

    Thanks...

    Dan

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

    Re: Accessing mailitem.to property via VBA (2002)

    Outlook 2002 has protection built in against programs using the Outlook object model to gain access to e-mails. You can get around this by using Extended MAPI. Outlook Redemption is a COM add-in that provides a relatively easy interface to Extended MAPI; it is free for development use.

    As far as I know, retrieving the Body property of a MailItem object doesn't "open" the message or activate viruses.

  3. #3
    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: Accessing mailitem.to property via VBA (2002)

    Dan, you appear to be a glutton for punishment. If you need 600 MB of test spam to fine-tune your software, tell me where to send the CD. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    But seriously, I have found the Redemption library to be fairly powerful in working around the security hurdles, but unless you are very careful with some of the objects, you can get horrible crashes. I posted a thread a while back on this and recommend religious use of the CleanUp method wherever applicable.

  4. #4
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accessing mailitem.to property via VBA (2002)

    Thanks guys! I'm going to check out Redemption, and keep in mind the warnings about being careful with the objects. I suppose, if nothing else, I'll learn a little about the internal workings of Outlook. I guess that 4000th advertisement for ** Spam post - please alert a Moderator ** was the straw that broke the camel's back.

    If I get anywhere with this, I'll let you know...

    Dan

Posting Permissions

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