1. Notice: I had to turn off email alerts for everyone. Anyone who wants email notification can re-enable the email alerts in their profile at outlookforums.com/account/preferences (and Alert Preferences). Also verify your email address is correct under Contact Details.

Code to Save Email as an .MSG to Directory when Emails Arrive

Discussion in 'Outlook VBA and Custom Forms' started by John, May 12, 2010.

  1. John

    John

    Guest
    I am trying to save all emails that come into the inbox as an .MSG to a

    directory on the server. I saw the ability to utilize the SAVEAS method but

    have no idea how to implement that to work as emails arrive. Any code help

    would be greatly appreciated.

    Thanks in advance

    John
  2. Michael Bauer [MVP - Outlook]

    Michael Bauer [MVP - Outlook]

    Guest
    This example requires that the directory exists already:

    http://www.vboffice.net/sample.html?lang=en&mnu=2&smp=7&cmd=showitem

    It works only if Outlook is running while you receive the message.

    --

    Best regards

    Michael Bauer - MVP Outlook




    Am Wed, 12 May 2010 08:51:01 -0700 schrieb John:


    > I am trying to save all emails that come into the inbox as an .MSG to a
    > directory on the server. I saw the ability to utilize the SAVEAS method


    but
    > have no idea how to implement that to work as emails arrive. Any code


    help
    > would be greatly appreciated.

    > Thanks in advance
    > John
  3. John

    John

    Guest
    Hey Michael,

    Sounds great...I change the path to a network path does it matter which way

    that I put the path should it be hard coded like \\ServerName\Folder or

    should it be like P:\Folder is the Drive is mapped on the computer running

    outlook. For some reason I am not getting an error message but it is not

    putting the file in the folder. When I tried to do it as a test to my

    C:\Temp I actually got a permissions error for some reason.

    Thanks again for all your help

    "Michael Bauer [MVP - Outlook]" wrote:




    > This example requires that the directory exists already:
    > http://www.vboffice.net/sample.html?lang=en&mnu=2&smp=7&cmd=showitem

    > It works only if Outlook is running while you receive the message.

    > --
    > Best regards
    > Michael Bauer - MVP Outlook
    > Category Manager -
    > SAM - The Sending Account Manager:
    >

    > Am Wed, 12 May 2010 08:51:01 -0700 schrieb John:
    >
    > > I am trying to save all emails that come into the inbox as an .MSG to a
    > > directory on the server. I saw the ability to utilize the SAVEAS method

    > but
    > > have no idea how to implement that to work as emails arrive. Any code

    > help
    > > would be greatly appreciated.
    > > Thanks in advance
    > > John

    > .
    >
  4. John

    John

    Guest
    Hey Michael,

    Disregard my message I figured out my error. Thanks so much for you help it

    works perfectly.

    Have a great one!

    John

    "John" wrote:


    > Hey Michael,

    > Sounds great...I change the path to a network path does it matter which way
    > that I put the path should it be hard coded like \\ServerName\Folder or
    > should it be like P:\Folder is the Drive is mapped on the computer running
    > outlook. For some reason I am not getting an error message but it is not
    > putting the file in the folder. When I tried to do it as a test to my
    > C:\Temp I actually got a permissions error for some reason.

    > Thanks again for all your help

    > "Michael Bauer [MVP - Outlook]" wrote:
    >
    > > This example requires that the directory exists already:
    > > http://www.vboffice.net/sample.html?lang=en&mnu=2&smp=7&cmd=showitem
    > > It works only if Outlook is running while you receive the message.
    > > --
    > > Best regards
    > > Michael Bauer - MVP Outlook
    > > Category Manager -
    > > SAM - The Sending Account Manager:
    > >
    > > Am Wed, 12 May 2010 08:51:01 -0700 schrieb John:
    > >
    > > > I am trying to save all emails that come into the inbox as an .MSG to a
    > > > directory on the server. I saw the ability to utilize the SAVEAS method

    > > but
    > > > have no idea how to implement that to work as emails arrive. Any code

    > > help
    > > > would be greatly appreciated.
    > > > > Thanks in advance
    > > > John

    > > .
    > >
  5. Chris

    Chris

    Guest
    John,

    What was your error. I too am not getting anything saved to the file.

    Chris

    "John" wrote:


    > Hey Michael,

    > Disregard my message I figured out my error. Thanks so much for you help it
    > works perfectly.

    > Have a great one!

    > John


    > "John" wrote:
    >
    > > Hey Michael,
    > > Sounds great...I change the path to a network path does it matter which way
    > > that I put the path should it be hard coded like \\ServerName\Folder or
    > > should it be like P:\Folder is the Drive is mapped on the computer running
    > > outlook. For some reason I am not getting an error message but it is not
    > > putting the file in the folder. When I tried to do it as a test to my
    > > C:\Temp I actually got a permissions error for some reason.
    > > Thanks again for all your help
    > > "Michael Bauer [MVP - Outlook]" wrote:
    > >
    > > > > > This example requires that the directory exists already:
    > > > http://www.vboffice.net/sample.html?lang=en&mnu=2&smp=7&cmd=showitem
    > > > > It works only if Outlook is running while you receive the message.
    > > > > --
    > > > Best regards
    > > > Michael Bauer - MVP Outlook
    > > > Category Manager -
    > > > SAM - The Sending Account Manager:
    > > >
    > > > > > Am Wed, 12 May 2010 08:51:01 -0700 schrieb John:
    > > > > > I am trying to save all emails that come into the inbox as an .MSG to a
    > > > > directory on the server. I saw the ability to utilize the SAVEAS method
    > > > but
    > > > > have no idea how to implement that to work as emails arrive. Any code
    > > > help
    > > > > would be greatly appreciated.
    > > > > > > Thanks in advance
    > > > > John
    > > > .
    > > >
Similar Threads
Forum Title Date
Using Outlook VB code to bulk save attachments deletes message Feb 23, 2012
Outlook VBA and Custom Forms Save Email as .msg File with Code Aug 9, 2009
Using Outlook VBA Code Save Emails as RTF Format Jun 23, 2009
Outlook VBA and Custom Forms save attachments code? Mar 24, 2009
Using Outlook Outlook 2007 Codes Export and Import Mar 24, 2014

Share This Page

Web accelerated by IISpeed - Page Speed optimization by Google for Microsoft IIS and ASP.NET