tbonfig
06-14-2021, 05:44 PM
Hi there
Back in the land before time, I used Lotus Notes which had an awesome feature of having a prompt pop up once you sent an email, allowing you to file it away in one swift action. For reasons I can probably figure out, this is not a feature in Outlook.
Historically, I was able to utilize some VBA code I found online. I know nothing about VBA so it was really a click and copy and paste and follow-the-instructions kind of situation for me.
For some reason, I have not had it work for a few years as I have changed jobs a few times and used different versions of Outlook. Unfortunately, I am illiterate when it comes to this stuff so my troubleshooting amounts to nothing.
I think this is the site/code I originally used years ago (not sure what version of Outlook I had at that time):
https://www.slipstick.com/outlook/email/choosing-the-folder-to-save-a-sent-message-in/
Here is the VBA code they want you to paste into the built-in ThisOutlookSession module in Outlook:
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
I put this in earlier and it worked that day. Then I had to restart my computer and now it no longer works.
I'm not sure how to troubleshoot it and hopeful someone can provide some assistance.
Thanks so much!
Back in the land before time, I used Lotus Notes which had an awesome feature of having a prompt pop up once you sent an email, allowing you to file it away in one swift action. For reasons I can probably figure out, this is not a feature in Outlook.
Historically, I was able to utilize some VBA code I found online. I know nothing about VBA so it was really a click and copy and paste and follow-the-instructions kind of situation for me.
For some reason, I have not had it work for a few years as I have changed jobs a few times and used different versions of Outlook. Unfortunately, I am illiterate when it comes to this stuff so my troubleshooting amounts to nothing.
I think this is the site/code I originally used years ago (not sure what version of Outlook I had at that time):
https://www.slipstick.com/outlook/email/choosing-the-folder-to-save-a-sent-message-in/
Here is the VBA code they want you to paste into the built-in ThisOutlookSession module in Outlook:
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
I put this in earlier and it worked that day. Then I had to restart my computer and now it no longer works.
I'm not sure how to troubleshoot it and hopeful someone can provide some assistance.
Thanks so much!