• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

use outlook rules to send message to network location

outlook 2007 or outlook 2010
looking to create a rule which sends a message to a mapped drive OR unc path

in the screenshot below you see what rules i can apply to a message

how can i achieve this?  ...what about using the "run a script" action?
what sort of script is required?  thanks for your help.
  • 3
  • 3
1 Solution
Chris BottomleyCommented:
Run script IS the way and something like:

Sub saveMailandAttach(mai As MailItem)
Dim dosFolderPath As String
Dim intIncrement As Integer
Dim fn As String
Dim ft As String
Dim FSO As Object
Dim Subject As String
Dim del As Variant

    dosFolderPath = "c:\deleteme\"
    If Right(dosFolderPath, 1) <> "\" Then dosFolderPath = dosFolderPath & "\"
    Set FSO = CreateObject("scripting.filesystemobject")
    Subject = Left(Replace(mai.Subject, """", " "), 20) & " " & mai.ReceivedTime
    For Each del In Array("/", ":", "*", "?", "<", ">", "|")
        Subject = Replace(Subject, del, " ")
    mai.saveas dosFolderPath & Subject & ".msg", olMsg

Set FSO = Nothing
End Sub

Open in new window

sknoll84Author Commented:
is that all it takes?  is it flaky?  reliable?  do you use this....?
Chris BottomleyCommented:
Is that all it takes, yes
Is it flakey ... might be if you're receiving hundreds of emails at a time
DO I use it ... yup in many permutations deleting attachments, saving attachments as well and the like.

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

sknoll84Author Commented:
added the developer tab to my outlook 2010

what do i do next?  open visual basic?  then what?

i'm not having much success.

Chris BottomleyCommented:
Insert a normal code module and paste the code there.

Call it from the rule.

Macro settings - enable macros

sknoll84Author Commented:
pow!  thanks for your help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now