Properties, events, methods of datacontainers

  • 1
  • Question
  • Updated 2 years 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 2 years ago

  • 1
Photo of Nick Duffill

Nick Duffill, Champion

  • 598 Posts
  • 242 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)


        If m_Topic.DataContainer.DataContainerType <> mmDataContainerTypeNone Then
           If m_Topic.BusinessTopic.BusinessTypeUri = "" 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.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("", "function",mmCustomPropertyFormatTypeText)
                       .DataContainer.InsertCustomProperties.SetCustomPropertyValue("", "jefe")

*******************the error appears here, i dont understand why? beacuse i am using a new property name*****************************************************
                       .DataContainer.InsertCustomProperties.CustomPropertyCollection.AddCustomProperty("", "age",mmCustomPropertyFormatTypeText)
                       .DataContainer.InsertCustomProperties.SetCustomPropertyValue("", "27")
                       End With

                         agranda= nuevotopico.DataContainer.Resizable()

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

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


End If
Resume Next 
End Sub