Re: Outlook Form + Public Folder(s)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Sue
I have used the Item.Move method as you said but I am getting this error
message:
"The item could not be saved to this folder. The folder has been deleted or
moved, or you do not have permission. Do you want to save copy of it in the
default folder for the item?" (YES / NO)
The wierd thing is when I click NO, the item still gets moved to the
appropriate folder. And here's my code:
'************************************************************
Function Item_Write()

Dim ResearchingFolder, ClosedFolder, AwaitingFolder, objOLNS

Set objOLNS = Application.GetNameSpace("MAPI")
Set ResearchingFolder = objOLNS.Folders("Public Folders")._
Folders("All Public Folders")._
Folders("International Office Folders")._
Folders("Asia Pacific Office Memos")._
Folders("Australia/New Zealand")._
Folders("Australia Finance")._
Folders("Commission Payment Issues")._
Folders("Researching")

Set ClosedFolder = objOLNS.Folders("Public Folders")._
Folders("All Public Folders")._
Folders("International Office Folders")._
Folders("Asia Pacific Office Memos")._
Folders("Australia/New Zealand")._
Folders("Australia Finance")._
Folders("Commission Payment Issues")._
Folders("Closed")

Set AwaitingFolder = objOLNS.Folders("Public Folders")._
Folders("All Public Folders")._
Folders("International Office Folders")._
Folders("Asia Pacific Office Memos")._
Folders("Australia/New Zealand")._
Folders("Australia Finance")._
Folders("Commission Payment Issues")._
Folders("Awaiting Approval")

Select Case Item.UserProperties.Find("02 Status").Value
Case "Researching"
Item.Move ResearchingFolder

Case "Awaiting Approval"
Item.Move AwaitingFolder

Case "Closed"
Item.Move ClosedFolder
End Select

End Function

'************************************************************
The error message does not seem to make much sense since I know my
permission is not an issue and I also know the folder exists. Is there any
other way to do this? Please help.
Boris



"Sue Mosher [MVP-Outlook]" wrote:

You have two choices. You can return the folder with the Namespace.GetFolderFormID method if you know the EntryID and StoreID. Or, you can to walk the folder hierarchy using the Folders collections or use a function that does that for you. See http://www.outlookcode.com/d/code/getfolder.htm and, especially for public folders, http://www.outlookcode.com/codedetail.aspx?id=1164

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"BOR155" <BOR155@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:225762DF-8D06-4B5F-9D41-F44B5FADA116@xxxxxxxxxxxxxxxx
Sue
Thank you for your reply, but I am still not sure how to refer to a
particular Public Folder, is it by it's name, or some sort if ID. Also, how
to refer to the current item (the one that needs to be moved)???
Could you please write few lines of sample code?
Many thanks in advance
Boris





"Sue Mosher [MVP-Outlook]" wrote:

Yes, it's possible. I'd put the code to call the Move method in the Item_Write event handler, since people could change their mind about the status before saving it. See http://www.outlookcode.com/d/propsyntax.htm if you need help with the syntax for retrieving the property value.

"BOR155" <BOR155@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:2E5F34D4-0348-4F1D-880C-3490C333D7E2@xxxxxxxxxxxxxxxx
I need to develop a form in Outlook for tracking Commission Payment related
issues for our Sales staff. All forms submitted will end up in a Public
Folder called "New Issues".
One of the fields on this form will be Issue Status like "Open", "In
Progress" and "Closed". I am planning to have a combo box on the form where
an analyst dealing with those issues will set the Issue status by selecting
one of three items listed in the combo. So what I need to have is some VB
Script code behind the form which will fire when the Status is changed and
move the item from the Public Folder "New Issues" to, say the folder "In
Progress" (this is if the Status is changed to "In Progress")....
Is this possible?? Any help would be greatly appreciated.


.



Relevant Pages

  • Re: Outlook Form + Public Folder(s)
    ... Set objOLNS = Application.GetNameSpace ... Folders("Asia Pacific Office Memos")._ ... Folders("Commission Payment Issues")._ ... "The item could not be saved to this folder. ...
    (microsoft.public.office.developer.outlook.forms)
  • Re: Outlook Form + Public Folder(s)
    ... Set objCopy = Item.Copy ... Folders("Asia Pacific Office Memos")._ ... Folders("Commission Payment Issues")._ ... "The item could not be saved to this folder. ...
    (microsoft.public.office.developer.outlook.forms)
  • Re: Outlook Form + Public Folder(s)
    ... I think it has to do with the caching that Outlook does as you open and close items. ... "The item could not be saved to this folder. ... Folders("Asia Pacific Office Memos")._ ... Folders("Commission Payment Issues")._ ...
    (microsoft.public.office.developer.outlook.forms)
  • Re: Views filtered by User properties (UDFs)
    ... Author of Configuring Microsoft Outlook 2003 ... Then Created a new Form Region binded to the udf folder fields. ...
    (microsoft.public.outlook.program_forms)
  • Re: Message Rule Does Not Run VBA Procedure
    ... My folder options are set to show hidden ... Author of Configuring Microsoft Outlook 2003 ... Dim olNS As Outlook.NameSpace ... Set olMail = Nothing ...
    (microsoft.public.outlook.program_vba)