Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 09-16-2010, 12:40 AM
Joostdegrote Joostdegrote is offline Outbox sent items issue Windows 7 Outbox sent items issue Office 2007
Advanced Beginner
Outbox sent items issue
 
Join Date: Sep 2010
Location: The Netherlands
Posts: 45
Joostdegrote is on a distinguished road
Default

OK.. So it kinda seems to be fixed..

(SOURCE: http://www.outlookcode.com/d/code/setsavefolder.htm )
Code:
Private Sub Application_ItemSend(ByVal Item As Object, _
    Cancel As Boolean)
  Dim objNS As NameSpace
  Dim objFolder As MAPIFolder
  Set objNS = Application.GetNamespace("MAPI")
  Set objFolder = objNS.PickFolder
  If TypeName(objFolder) <> "Nothing" And _ 
     IsInDefaultStore(objFolder) Then
      Set Item.SaveSentMessageFolder = objFolder
  End If
  Set objFolder = Nothing
  Set objNS = Nothing
End Sub
Public Function IsInDefaultStore(objOL As Object) As Boolean
  Dim objApp As Outlook.Application
  Dim objNS As Outlook.NameSpace
  Dim objInbox As Outlook.MAPIFolder
  On Error Resume Next
  Set objApp = CreateObject("Outlook.Application")
  Set objNS = objApp.GetNamespace("MAPI")
  Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
  Select Case objOL.Class
    Case olFolder
      If objOL.StoreID = objInbox.StoreID Then
        IsInDefaultStore = True
      End If
    Case olAppointment, olContact, olDistributionList, _
         olJournal, olMail, olNote, olPost, olTask
      If objOL.Parent.StoreID = objInbox.StoreID Then
        IsInDefaultStore = True
      End If
    Case Else
      MsgBox "This function isn't designed to work " & _
             "with " & TypeName(objOL) & _
             " items and will return False.", _
             , "IsInDefaultStore"
  End Select
  Set objApp = Nothing
  Set objNS = Nothing
  Set objInbox = Nothing
End Function
When putting this to Extra>>Makro's>> Visual Basic Editor (there go to Project1> Microsoft office outlook>ThisOutlookSession)
I get a pop-up window saying where to save the sent item. If i don't specify the folder, it won't be saved at all!

Somehow, i still have a problem.. now that i rebooted Outlook, I don't get no pop-up no more... While the script still is in there! So somehow..... It's screwed up anyway .... anyone here has an idea how/why?
Reply With Quote
 

Tags
sent as, sent items



Similar Threads
Thread Thread Starter Forum Replies Last Post
manually sending a message from outbox Mr.McRude Outlook 0 06-17-2010 11:46 AM
Outlook 2007 Saved sent items list only holds the last ten items david.peake Outlook 0 06-01-2010 07:27 PM
Outbox not creating email saiyedhashmi Outlook 0 11-30-2009 09:25 PM
Outbox sent items issue 2007 Outlook Outbox issues MrPerkins Outlook 1 04-25-2009 03:14 PM
Outbox sent items issue outgoing messages going to outbox and not sending markmerid Outlook 1 01-17-2007 02:43 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft