none
Add task in subfolder shared RRS feed

  • Question

  • Hi

     I would like to add tasks in a subfolders of my teammembers.   

    When I run the code, the problems is that I can't find the subfolder. I just reach the default folder.


    Error '-2147221233 (8004010F)'. Not found the object.

    Dim olApp As Object, objNS As Object, defaultTasksFolder As Object, subFolder As Object, OlTask As Object
       Dim objectOutlook As Object
       Dim objectTarea As Object
       Dim i As Integer
       Dim imoderador As Integer
       Dim Moderador As String
       'Const OlFoldertasks As Long = 13
       Const OlTaskItem As Long = 3
        Dim myNamespace As Outlook.Namespace
      Dim myRecipient As Outlook.Recipient

    'Iniciamos MS Outlook... si no estuviera ya abierto
    On Error Resume Next
    Set olApp = GetObject(, "Outlook.Application")
    If Err.Number <> 0 Then 'si no está abierto
    Set olApp = CreateObject("Outlook.Application")
    End If
    On Error GoTo 0

     Set olApp = CreateObject("Outlook.Application")
    Set NS = olApp.GetNamespace("MAPI")
    NS.Logon
    Set Recip = NS.CreateRecipient("danielalberto.mansilla@kcc.com")
    Set SharedFolder = NS.GetSharedDefaultFolder(Recip, OlFoldertasks)
    Set subFolder = SharedFolder.Folders("prueba")

    Here apparece the error.

    Friday, July 19, 2019 10:18 PM

Answers

  • Make sure "Download Shared Folders" checkbox is unchecked on the Advanced tab of the Exchange account options. If the delegate folders are cached, Outlook does not cache the subfolders, only the folder itself.

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

    • Marked as answer by FacuPerez Saturday, July 20, 2019 7:53 PM
    Friday, July 19, 2019 10:25 PM

All replies

  • Make sure "Download Shared Folders" checkbox is unchecked on the Advanced tab of the Exchange account options. If the delegate folders are cached, Outlook does not cache the subfolders, only the folder itself.

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

    • Marked as answer by FacuPerez Saturday, July 20, 2019 7:53 PM
    Friday, July 19, 2019 10:25 PM
  • GREAT THANK YOU SO MUCH!!!!!!!!!!
    Saturday, July 20, 2019 7:54 PM