Answered save taskitem in outlook using VBA

  • Friday, August 03, 2012 1:07 PM
     
     

    прошу вас подсказать как сделать используя встроенный язык программирования сохранение созданного taskitem в другую папку. например

    please tell how to use the built-in programming language that built taskitem to another folder. for example

    Public Sub Otch()

    Dim aOl As Outlook.Application
    Dim iA As Outlook.TaskItem

    Set iA = aOl.CreateItem(olTaskItem)
    iA.Subject = "rnd"
    iA.Save

    End Sub
    этот код сохранит  созданную задачу в папку по умолчанию "Задачи", что изменить в этом коде для того чтоб задача попала в рядос созданный стисок "Срочное"

    This code saves the task created in the default folder "Tasks" that the change in the code for that to hit the problem created by ryados stisok "Urgent"

    ______________________________________________________

All Replies

  • Friday, August 03, 2012 2:06 PM
     
     Answered Has Code

    If you're saying you want to move an item from the default location where it's saved to a different folder, one approach would be the following:

    Public Sub Otch()
    
    Dim aOl As Outlook.Application
    Dim iA As Outlook.TaskItem
    
    
    Set iA = aOl.CreateItem(olTaskItem)
    iA.Subject = "rnd"
    iA.Save
    Call iA.Move(Session.GetDefaultFolder(olFolderDrafts))
    
    End Sub

    The above code would move the new TaskItem to the Drafts folder; replace the GetDefaultFolder call with whichever folder you desire.

    -Brian

  • Friday, August 03, 2012 6:34 PM
     
     Answered

    Keep in mind that Move() is a function that returns the new item, not a sub:

    set iA = iA.Move(Session.GetDefaultFolder(olFolderDrafts))


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!