Having two exchange mailboxes open in outlook and sending from each one

We have put in a new "networked" fax machine and it sends all incoming Faxes to an exchange (5.5) mailbox.  Our receptionist has this mailbox along with her personal mailbox (also and exchange mailbox) open in outlook.  She then will forward the "Fax" emails to the appropriate recipient selecting the Fax mailbox as the sender.  The problem we are having is that when she forwards the email that is in the "Fax" mailbox, it goes into the sent folder for her mailbox.  Right now I have a rule set up to copy the sent email to the "Fax's" sent folder, but have not figured out a way to automatically delete it from her sent folder after it copies it to "Fax's" sent folder.  She is using Outlook 2000 sp3 on a Windows 2000 professional sp4 machine.  Again, our version of Exchange is 5.5 sp4

Who is Participating?
David LeeConnect With a Mentor Commented:
Sorry to be so slow getting back to you on this.  The code below will do what you described.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code and paste it into the right-hand pane of the VB Editor window
5.  Click the diskette icon on the toolbar to save the changes
6.  Close the VB Editor
7.  Click Tools->Macro->Security
8.  Set the Security Level to Medium
9.  Close Outlook
10.  Start Outlook
11.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.
12.  Disable the rule you're using now.  The script performs handles the whole action.

Dim WithEvents olkSentItems As Outlook.Items

Private Sub Application_Quit()
    Set olkSentItems = Nothing
End Sub

Private Sub Application_Startup()
    Set olkSentItems = Session.GetDefaultFolder(olFolderSentMail).Items
End Sub

Private Sub olkSentItems_ItemAdd(ByVal Item As Object)
    If Item.Class = olMail Then
        'Change the next line as needed so the code to move the messages only fires for the forwarded faxes.  You should be able to use whatever you used for
        'the rule.
        If Item.Subject = "Fax" Then
            'Change the mailbox path on the next line to that of the fax mailbox.
            Item.Move OpenMAPIFolder("\Fax Mailbox\Sent Items")
        End If
    End If
End Sub

'Credit where credit is due.
'The code below is not mine.  I found it somewhere on the internet but do
'not remember where or who the author is.  The original author(s) deserves all
'the credit for these functions.
Function OpenMAPIFolder(szPath)
    Dim app, ns, flr, szDir, i
    Set flr = Nothing
    Set app = CreateObject("Outlook.Application")
    If Left(szPath, Len("\")) = "\" Then
        szPath = Mid(szPath, Len("\") + 1)
        Set flr = app.ActiveExplorer.CurrentFolder
    End If
    While szPath <> ""
        i = InStr(szPath, "\")
        If i Then
            szDir = Left(szPath, i - 1)
            szPath = Mid(szPath, i + Len("\"))
            szDir = szPath
            szPath = ""
        End If
        If IsNothing(flr) Then
            Set ns = app.GetNamespace("MAPI")
            Set flr = ns.Folders(szDir)
            Set flr = flr.Folders(szDir)
        End If
    Set OpenMAPIFolder = flr
End Function

Function IsNothing(obj)
  If TypeName(obj) = "Nothing" Then
    IsNothing = True
    IsNothing = False
  End If
End Function
David LeeCommented:
I believe I can solve this with a macro.  Is that an option?
mayfran-itAuthor Commented:
sure.  i would be willing to try that.


All Courses

From novice to tech pro — start learning today.