Problem with .move command

Mar 23, 2016
Reaction score

I have made some code in Outlook that will monitor all incoming emails on a common mail account.

If an incoming email is meeting certain criteria’s, the email will be moved to a specific folder.

We are several users that are running this code on the same email account. The problem occurs if the code start on the same email on one users Outlook, before another person Outlook is finished with the code.

The .move command will then make a copy of the email instead of moving.

I have found a way to trap the error, so the user is not presented with the error message. But the problem is that the .move command will make a copy, and I do not want that to happen.

Any suggestion to how I should structure the code so that it will work in a multiuser evironment

Here is part of the code


Public Sub DokumentSenter(FaktMail As Object)

Dim BackupFolder As Outlook.Folder

Dim gnspNameSpace As Outlook.NameSpace

Set gnspNameSpace = Outlook.GetNamespace("MAPI") 'Outlook Object

Set BackupFolder = gnspNameSpace.Folders("Merverdi Faktura").Folders("Inbox").Folders("BackupFaktura")

On Error GoTo ErrHandler

FaktMail.Move BackupFolder


Exit Sub


Call SkrivTilHyperion(FaktMail, "ErrHandler Dok.Senter")

Resume Slutt

End Sub




Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question