
Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
>>After declaring various undeclared variables the code
I wasn't getting any error messages on that but I think I have
everything declared now (VB is not my primary langauge and the code was
mostly picked up from other posts here.) I'll put the updated code at
the end of this message.
>>elevate your permissions to owner
Done and I gave myself full admin and directory rights as well. No
change.
>> Are any of the items you're attempting to move flagged as complete?
objItem.FlagStatus = olNoFlag
>>Set objMoved = objEmail.Move(objFolder)
Same error
>> Any problems running any other macros?
Not that I'm aware of.
>>> What version of Outlook and Windows?
Client:
Windows XP SP2
Outlook 2002 SP3
Server:
SBS2000 SP4
Exchange Server 2000 SP3
I am not an overly experienced exchange administrator, so it is
possible that there is something wrong in that setup. It is mostly a
default SBS setup.
BTW the code works fine if I use:
'Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
'Set objFolder = objInbox.Folders("Spam")
Instead of the public folder.
Thanks for your help on this.
John
Revised Code:
Sub MoveSpam()
Dim objFolder As Outlook.MAPIFolder
Dim objInbox As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace
Dim objItem As Outlook.MailItem
Dim objMoved As Outlook.MailItem
Set objNS = Application.GetNamespace("MAPI")
'Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
'Set objFolder = objInbox.Folders("Spam")
Set objFolder = objNS.Folders("Public Folders").Folders("All Public
Folders").Folders("GFI AntiSpam Folders").Folders("This is spam email")
If objFolder Is Nothing Then
MsgBox "This folder doesn't exist!", vbOKOnly + vbExclamation,
"INVALID FOLDER"
Exit Sub
End If
If Application.ActiveExplorer.Selection.Count = 0 Then
'Require that this procedure be called only when a message is
selected
Exit Sub
End If
For intX = ActiveExplorer.Selection.Count To 1 Step -1
Set objItem = ActiveExplorer.Selection.Item(intX)
If objItem.Class = olMail Then
'objItem.Move objFolder
Set objMoved = objItem.Move(objFolder)
End If
Next
Set objItem = Nothing
Set objFolder = Nothing
Set objInbox = Nothing
Set objNS = Nothing
Set objMoved = Nothing
End Sub
> I finally got some time to test your code here, after I created the correct
> public folder tree. After declaring various undeclared variables the code
[quoted text clipped - 104 lines]
> >> Set objNS = Nothing
> >> End Sub
Ken Slovak - [MVP - Outlook] - 04 Dec 2006 16:55 GMT
If it works for Inbox it should work for the public folder. The code worked
for me for a public folder, so my only guess is it's some permissions issue.
The only move issue I'm aware of is the one with a flag marked complete, but
that would also affect moves to any other folder.
Still the same error message?

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
>>>After declaring various undeclared variables the code
>
[quoted text clipped - 87 lines]
> Set objMoved = Nothing
> End Sub
JohnFenton - 05 Dec 2006 22:47 GMT
I posted a reply yesterday but it's not showing.
>>> Still the same error message?
Yes
Maybe I have something setup wrong on the server, but it's odd that I
can drag and drop the file into the same directory without any
problems.
John
> If it works for Inbox it should work for the public folder. The code worked
> for me for a public folder, so my only guess is it's some permissions issue.
[quoted text clipped - 102 lines]
> > Set objMoved = Nothing
> > End Sub
Ken Slovak - [MVP - Outlook] - 06 Dec 2006 14:15 GMT
It's odd but the code works here so there's nothing intrinsically wrong with
it. I have no idea why it's not working for you.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> I posted a reply yesterday but it's not showing.
>
[quoted text clipped - 7 lines]
>
> John
JohnFenton - 08 Dec 2006 00:14 GMT
Thanks for checking this out for me. I greatly appreciate it.
So I'm guessing if I want to resolve this the next step would be paid
tech support. Or is there another place I should try first?
John
> It's odd but the code works here so there's nothing intrinsically wrong with
> it. I have no idea why it's not working for you.
[quoted text clipped - 18 lines]
> >
> > John
Ken Slovak - [MVP - Outlook] - 08 Dec 2006 18:43 GMT
Paid support is certainly an option. I'd also maybe explore setting up
different computers and/or virtual machines and see if things are the same
there. I'd also be playing with new profiles and possibly impersonating
other users to see how deep this problem goes. All I can say is running as
usual as admin and accessing the PF as owner the code worked for me. I also
ran it as my dog, who's an Exchange admin but a power user as a Windows
logon and who had publishing author rights on that PF.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Thanks for checking this out for me. I greatly appreciate it.
>
> So I'm guessing if I want to resolve this the next step would be paid
> tech support. Or is there another place I should try first?
>
> John
JohnFenton - 15 Dec 2006 02:05 GMT
>>Paid support is certainly an option. ...
You were right, I played around a bit more and found it.
PGP was interfering with it. Shutting down PGP alowed it to move just
fine. Now I have to see if I can work around the PGP problem.
John
> Paid support is certainly an option. I'd also maybe explore setting up
> different computers and/or virtual machines and see if things are the same
[quoted text clipped - 18 lines]
> >
> > John
Ken Slovak - [MVP - Outlook] - 15 Dec 2006 14:39 GMT
Interesting. Thanks for following up and letting us know it was PGP causing
the problem.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
>>>Paid support is certainly an option. ...
>
[quoted text clipped - 4 lines]
>
> John