I tried to remove this... still no luck
The process fails on trying to execute
myItem.Move destFolder
"Alan Moseley" wrote:
I think I see your problem. When you open Outlook you are setting myItem to
be the CurrentItem of the ActiveInspector (within the Application_Startup
Sub). Surely when you open outlook you won't have an ActiveInspector. You
need to set myItem when opening a MailItem surely?
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk
If I have solved your problem, please click Yes below. Thanks.
"Vasil Vasilev" wrote:
Hi Alan,
thanks for the answer.
Unfortunatelly the problem still persists.
No change...
"Alan Moseley" wrote:
You are creating a separate process for your myApp object, which you don't
need and will cause problems. Your code doesn't actaully use the myApp
object anywhere so you don't need any of them, but if other areas of your
code do make use of them then change :-
Dim myApp As New Outlook.Application
to
Dim myApp As Outlook.Application
next change
Set myApp = CreateObject("Outlook.Application")
to
set myApp = Outlook
Lastly change
Set objNS = GetNamespace("MAPI")
to
Set objNS = Outlook.GetNamespace("MAPI")
or
Set objNS = myApp.GetNamespace("MAPI")
Does this prevent the problem?
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk
If I have solved your problem, please click Yes below. Thanks.