outlook 2013 must pop out a dialog box and ask me where to save email before sending the email

I want that outlook 2013 must pop out a dialog box and ask me where to save email before sending the email if I am composing a new email or replying to an email placed in inbox.

I have found a macro that works fine except it pop out dialog box for every email.:
http://www.outlookcode.com/article.aspx?id=48 

The reply to the emails placed in a folder other than inbox get saved in that folder only. (thanks to outlook inbuilt option : When replying to a message that is not in the inbox, save the reply in the same folder) This is good. But I don't want new emails that I am composing or the replies that I am sending to the emails placed in the inbox should be saved in default sent folder. It must ask me where to save. (if the original mail to which I am replying could also be moved to the same folder where I am saving the sent item it would be a bliss for me.... am i over expecting? :D )

I guess if somebody could help me in modifying the macro : http://www.outlookcode.com/article.aspx?id=48 
 in such a way that:

The above code should pop out the dialog box only when I am sending a new email or replying to the emails placed in inbox.

I use pop3 to get my emails, not exchange.

Thanks :)
LVL 2
Akash BansalIT ProfessionalAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ltlbearand3Commented:
I believe if you add in an If Statement to check if SaveSentMessageFolder = Sent Items, it should accomplish what you want.

Private Sub Application_ItemSend(ByVal Item As Object, _
                                 Cancel As Boolean)
	Dim objNS As NameSpace
	Dim objFolder As MAPIFolder
	On Error Resume Next
	Set objNS = Application.Session
	If Item.Class = olMail Then
		If Item.SaveSentMessageFolder = "Sent Items" Then
			Set objFolder = objNS.PickFolder
			If Not objFolder Is Nothing And _
				IsInDefaultStore(objFolder) And _
				objFolder.DefaultItemType = olmailitem Then
				
				Set Item.SaveSentMessageFolder = objFolder
			Else
				Set objFolder = objNS.GetDefaultFolder(olFolderSentMail)
				Set Item.SaveSentMessageFolder = objFolder
			End If
		End If
	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
    Dim blnBadObject As Boolean
    On Error Resume Next
    Set objApp = objOL.Application
    If Err = 0 Then
        Set objNS = objApp.Session
        Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
        Select Case objOL.Class
            Case olFolder
                If objOL.StoreID = objInbox.StoreID Then
                    IsInDefaultStore = True
                Else
                    IsInDefaultStore = False
                End If
            Case olAppointment, olContact, olDistributionList, _
                 olJournal, olMail, olNote, olPost, olTask
                If objOL.Parent.StoreID = objInbox.StoreID Then
                    IsInDefaultStore = True
                Else
                    IsInDefaultStore = False
                End If
            Case Else
                blnBadObject = True
        End Select
    Else
        blnBadObject = True
    End If
    If blnBadObject Then
        MsgBox "This function isn't designed to work " & _
                "with " & TypeName(objOL) & _
                " objects and will return False.", _
                , "IsInDefaultStore"
        IsInDefaultStore = False
    End If
    Set objApp = Nothing
    Set objNS = Nothing
    Set objInbox = Nothing
End Function

Open in new window


Also, I have not fully tested, but I believe you can just simply the code to this in Outlook 2013

Private Sub Application_ItemSend(ByVal Item As Object, _
                                 Cancel As Boolean)
    Dim objFolder As Outlook.Folder
    If Item.Class = olMail Then
        If Item.SaveSentMessageFolder = "Sent Items" Then
            Set objFolder = Session.PickFolder
            If Not (objFolder Is Nothing) Then
                Set Item.SaveSentMessageFolder = objFolder
            End If
        End If
    End If
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Akash BansalIT ProfessionalAuthor Commented:
Wow it worked instantly!
Thanks for the modified code. :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.