Properties, events, methods of datacontainers

  • 1
  • Question
  • Updated 9 months ago
  • (Edited)
Hello, my question is : I understand that a datacontainer is the name of the characteristic of topics which have outlook information such as an appointment or a task and properties created by the user too; i want to know which are the properties of a datacontainer? i mean, i want to know by code if a determined datacontainer is an outlook appointment or an outlook task. Thanks in advance for your support
Photo of Luis Fernando Merlano

Luis Fernando Merlano

  • 9 Posts
  • 0 Reply Likes

Posted 9 months ago

  • 1
Photo of Nick Duffill

Nick Duffill, Champion

  • 530 Posts
  • 179 Reply Likes
The data container has a URI property, which I think is unique for each type of content. The URIs are not published anywhere, but you can find them by creating examples of each content type and reading the URI.
Photo of Luis Fernando Merlano

Luis Fernando Merlano

  • 9 Posts
  • 0 Reply Likes
Hi Nick i did it exactly what you mentioned and i found the URI for a topic with custom properties; however when i try to add a new property in the same topic; the error is "Invalid or Duplicated URI"; is there any way to add new properties in the same topic? my code  is as follows:


Sub ShowHideDataContainers(ByVal m_Doc As Document, ByVal b_Visible As Boolean)
    Dim m_Topic As Topic
    Dim m_subtopic As Topic
    Dim a As String
    Dim nuevotopico As Topic

    Dim i As Integer
    Dim separador As String

    For Each m_Topic In m_Doc.Range(mmRangeAllTopics, True)


        m_Topic.SelectOnly


        If m_Topic.DataContainer.DataContainerType <> mmDataContainerTypeNone Then
           If m_Topic.BusinessTopic.BusinessTypeUri = "http://uri.mindjet.com/Mm6OutlookLinker/2005/Appointment" Then
              a = m_Topic.Task.Resources
              Dim txt() As String
              separador = ";"
              txt= Split(a, separador)
              For i =LBound(txt) To UBound(txt)
                  m_Topic.AddSubTopic("" & LTrim(txt(i)) & "")
              Next i
              For Each m_subtopic In m_Topic.SubTopics(True) ' include filtered-out subtopics
                  If m_subtopic.Text<> "" Then
                     m_subtopic.SelectOnly
                     m_subtopic.Text = Replace(m_subtopic.Text,"  "," ")
                     Set nuevotopico= m_subtopic
                     'On Error GoTo cargargenerico


                     nuevotopico.CreateImage("D:\OneDrive - Grupo EPM\Estrategia\(Carp. P.)\1. Dllo. Pnal\1.2. Pnales\Back Ups\CORREO\Archivos de Outlook\Fotos\" & m_subtopic.Text & ".jpg")
                     'nuevotopico.Image.SaveWithSize("D:\OneDrive - Grupo EPM\Estrategia\(Carp. P.)\1. Dllo. Pnal\1.2. Pnales\Back Ups\CORREO\Fotos\" & m_subtopic.Text & ".jpg",mmGraphicTypeJpeg, 40.32, 40.32)
                      With nuevotopico
                        
                       .DataContainer.InsertCustomProperties.CustomPropertyCollection.AddCustomProperty("http://www.mindjet.com/MindManager/BusinessTypeCoreCustomProperties/2004", "function",mmCustomPropertyFormatTypeText)
                       .DataContainer.InsertCustomProperties.SetCustomPropertyValue("http://www.mindjet.com/MindManager/BusinessTypeCoreCustomProperties/2004", "jefe")

*******************the error appears here, i dont understand why? beacuse i am using a new property name*****************************************************
                       .DataContainer.InsertCustomProperties.CustomPropertyCollection.AddCustomProperty("http://www.mindjet.com/MindManager/BusinessTypeCoreCustomProperties/2004", "age",mmCustomPropertyFormatTypeText)
                       .DataContainer.InsertCustomProperties.SetCustomPropertyValue("http://www.mindjet.com/MindManager/BusinessTypeCoreCustomProperties/2004", "27")
)
                       End With

                         agranda= nuevotopico.DataContainer.Resizable()


                     u = nuevotopico.Image.Width
                     DoEvents
                  End If
              Next
              m_Topic.DataContainer.Visible = b_Visible

           End If
        End If
    Next
    Exit Sub
cargargenerico:
posicion= InStr(1, nuevotopico.Text, " ")
ultimaletraprimernombre = Mid(nuevotopico.Text,posicion-1, 1)
If ultimaletraprimernombre = "A" Then


    nuevotopico.CreateImage("C:\Users\Asus-pc\AppData\Local\Mindjet\MindManager\19\Library\ENU\Images\Legacy\People\people_exec_female.png")
        Else
    nuevotopico.CreateImage("C:\Users\Asus-pc\AppData\Local\Mindjet\MindManager\19\Library\ENU\Images\Legacy\People\people_exec_male.png")

End If
Resume Next 
End Sub