C
Carol G
This does not save the new task in the Test folder. In fact it doesn't seem
to be saving anywere.
Thanks for any help.
Carol
Public Sub TaskTest()
Dim objApp As Outlook.Application
Dim MyTasksFolder As Outlook.MAPIFolder
Dim MyFolder As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace
Dim objItm As TaskItem
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set MyTasksFolder = objNS.GetDefaultFolder(olFolderTasks)
Set MyFolder = MyTasksFolder.Folders("Test")
Debug.Print MyFolder
Set objItm = objApp.CreateItem(olTaskItem)
objItm.Subject = "Test of Task2"
'Debug.Print objItm.Subject
objItm.SaveAs (MyFolder)
Debug.Print objItm.Subject
End Sub
to be saving anywere.
Thanks for any help.
Carol
Public Sub TaskTest()
Dim objApp As Outlook.Application
Dim MyTasksFolder As Outlook.MAPIFolder
Dim MyFolder As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace
Dim objItm As TaskItem
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set MyTasksFolder = objNS.GetDefaultFolder(olFolderTasks)
Set MyFolder = MyTasksFolder.Folders("Test")
Debug.Print MyFolder
Set objItm = objApp.CreateItem(olTaskItem)
objItm.Subject = "Test of Task2"
'Debug.Print objItm.Subject
objItm.SaveAs (MyFolder)
Debug.Print objItm.Subject
End Sub