![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
I'm using outlook 2002 with Exchange server and I'm trying to change my code using vba the default folder where the sent item are saved to a folder which is on a public folder. My code works great when the folder is on my mailbox but when the folder is located on the network I get a message from outlook saying : "The Operation failed". Does anyone know why and how I can make it work ? Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) ' Set the NameSpace object. Set olns = Item.Application.GetNamespace("MAPI") ' MyFolder is a variant variable whose subtype is "object" since a Set statement is used. Set MyMailbox = olns.Folders("Public Folders") Set MyFolder1 = MyMailbox.Folders("All Public Folders") Set MyFolder2 = MyFolder1.Folders("Important") Set MyFolder3 = MyFolder2.Folders("Document") ' Correctly sets the folder where the "sent item" will be stored. Set Item.SaveSentMessageFolder = MyFolder Item.SaveSentMessageFolder = MyFolder End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|