Hi,
Need help on creating a macro to setup custom reminder after email sent.
I want to have a macro /vba to ask for:
1. Category; 2) Custom reminder date / time; 3) folder to move the email to.
This will be triggered after sending out email.
So I use the itemadd event in the sentmail folder.
Using ShowCategoriesDialog to prompt and set Categories;
PickFolder to prompt for the folder to move the email to;
I am looking for a way to pop the Custom Reminder dialog
or can someone point me to a date time picker so that I can prompt for the reminder date / time?
Thanks a million
KL
My prelim code:
****************
Public WithEvents olApp As Outlook.Application
Public WithEvents items As Outlook.items
Public Sub Init()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Set olApp = Outlook.Application
Set objNS = olApp.GetNamespace("MAPI")
Set items = objNS.GetDefaultFolder(olFolderSentMail).items
End Sub
Private Sub Items_ItemAdd(ByVal Item As Object)
Dim prompt As String
Dim objFolder
Dim sFolder
Dim Msg As Outlook.MailItem
Dim olInbox As Outlook.MAPIFolder
Dim strPST As String
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim intDay As Integer
Dim Path As String
Dim strFile As String
Dim selCats As String
Dim gotCats As Boolean
Set Msg = Item
With Msg
If .To = .SenderName Then
.ShowCategoriesDialog
selCats = .Categories
If selCats <> "" Then .Save
Set objNS = Application.GetNamespace("MAPI")
Set sFolder = objNS.GetDefaultFolder(olFolderSentMail)
Set objFolder = objNS.PickFolder
.FlagStatus = olFlagMarked
.ReminderTime = Now()
.FlagDueBy = Now()
.FlagIcon = olRedFlagIcon
.ReminderOverrideDefault = True
.ReminderSet = True
.Save
If TypeName(objFolder) <> "Nothing" And TypeName(objFolder) <> TypeName(sFolder) Then
.Move objFolder
End If
Set objFolder = Nothing
Set objNS = Nothing
End If
End With
End Sub
**************
Need help on creating a macro to setup custom reminder after email sent.
I want to have a macro /vba to ask for:
1. Category; 2) Custom reminder date / time; 3) folder to move the email to.
This will be triggered after sending out email.
So I use the itemadd event in the sentmail folder.
Using ShowCategoriesDialog to prompt and set Categories;
PickFolder to prompt for the folder to move the email to;
I am looking for a way to pop the Custom Reminder dialog
or can someone point me to a date time picker so that I can prompt for the reminder date / time?
Thanks a million
KL
My prelim code:
****************
Public WithEvents olApp As Outlook.Application
Public WithEvents items As Outlook.items
Public Sub Init()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Set olApp = Outlook.Application
Set objNS = olApp.GetNamespace("MAPI")
Set items = objNS.GetDefaultFolder(olFolderSentMail).items
End Sub
Private Sub Items_ItemAdd(ByVal Item As Object)
Dim prompt As String
Dim objFolder
Dim sFolder
Dim Msg As Outlook.MailItem
Dim olInbox As Outlook.MAPIFolder
Dim strPST As String
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim intDay As Integer
Dim Path As String
Dim strFile As String
Dim selCats As String
Dim gotCats As Boolean
Set Msg = Item
With Msg
If .To = .SenderName Then
.ShowCategoriesDialog
selCats = .Categories
If selCats <> "" Then .Save
Set objNS = Application.GetNamespace("MAPI")
Set sFolder = objNS.GetDefaultFolder(olFolderSentMail)
Set objFolder = objNS.PickFolder
.FlagStatus = olFlagMarked
.ReminderTime = Now()
.FlagDueBy = Now()
.FlagIcon = olRedFlagIcon
.ReminderOverrideDefault = True
.ReminderSet = True
.Save
If TypeName(objFolder) <> "Nothing" And TypeName(objFolder) <> TypeName(sFolder) Then
.Move objFolder
End If
Set objFolder = Nothing
Set objNS = Nothing
End If
End With
End Sub
**************