A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Problem with : SaveSentMessageFolder



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 11th 06, 09:36 PM posted to microsoft.public.outlook.program_vba
Nader
external usenet poster
 
Posts: 29
Default Problem with : SaveSentMessageFolder

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.