<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to write multi-value metadata properties using arcobjects? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-write-multi-value-metadata-properties-using/m-p/442400#M12016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to update metadata using ArcObjects. This is easy for simple properties such as "dataIdInfo/idCitation/resTitle" using IPropertySet.SetProperty(Name, Value). But I can't find any information or example, how to add values for multivalue-properties such as "dataIdInfo/themeKeys/keyword".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works (code snippet):&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;pMetaData = pDatasetName&lt;/P&gt;&lt;P&gt;Dim pPropSet As IPropertySet&lt;/P&gt;&lt;P&gt;pPropSet = pMetaData.Metadata&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/idCitation/resTitle", "Test1")&lt;/P&gt;&lt;P&gt;pMetaData.Metadata = pPropSet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to write a few tags:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;dataIdInfo/themeKeys/keyword:&amp;nbsp; AAA&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;dataIdInfo/themeKeys/keyword:&amp;nbsp; BBB&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of:&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/themeKeys/keyword", "AAA")&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/themeKeys/keyword", "BBB")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Tags:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BBB, BBB, BBB, BBB, BBB, BBB, BBB&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN title=""&gt;All tags contained so far have been replaced with the last keyword (&lt;/SPAN&gt;&lt;/SPAN&gt;there were&amp;nbsp;7 tags before).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also this don't work (ArgumentException):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; pNames(1), pValues(1) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pNames(0) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"dataIdInfo/searchKeys/keyword"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pNames(1) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"dataIdInfo/searchKeys/keyword"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pValues(0) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"AAA"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pValues(1) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"BBB"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pPropSet.SetProperty(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"dataIdInfo/searchKeys/keyword"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;, pValues)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this (ArgumentException):&lt;/P&gt;&lt;P&gt;pPropSet.SetProperties(pNames, pValues)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to deal with it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Aug 2019 11:01:22 GMT</pubDate>
    <dc:creator>HagenProbsthain1</dc:creator>
    <dc:date>2019-08-14T11:01:22Z</dc:date>
    <item>
      <title>How to write multi-value metadata properties using arcobjects?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-write-multi-value-metadata-properties-using/m-p/442400#M12016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to update metadata using ArcObjects. This is easy for simple properties such as "dataIdInfo/idCitation/resTitle" using IPropertySet.SetProperty(Name, Value). But I can't find any information or example, how to add values for multivalue-properties such as "dataIdInfo/themeKeys/keyword".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works (code snippet):&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;pMetaData = pDatasetName&lt;/P&gt;&lt;P&gt;Dim pPropSet As IPropertySet&lt;/P&gt;&lt;P&gt;pPropSet = pMetaData.Metadata&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/idCitation/resTitle", "Test1")&lt;/P&gt;&lt;P&gt;pMetaData.Metadata = pPropSet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to write a few tags:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;dataIdInfo/themeKeys/keyword:&amp;nbsp; AAA&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;dataIdInfo/themeKeys/keyword:&amp;nbsp; BBB&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of:&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/themeKeys/keyword", "AAA")&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/themeKeys/keyword", "BBB")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Tags:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BBB, BBB, BBB, BBB, BBB, BBB, BBB&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN title=""&gt;All tags contained so far have been replaced with the last keyword (&lt;/SPAN&gt;&lt;/SPAN&gt;there were&amp;nbsp;7 tags before).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also this don't work (ArgumentException):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; pNames(1), pValues(1) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pNames(0) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"dataIdInfo/searchKeys/keyword"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pNames(1) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"dataIdInfo/searchKeys/keyword"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pValues(0) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"AAA"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pValues(1) = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"BBB"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;pPropSet.SetProperty(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"dataIdInfo/searchKeys/keyword"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;, pValues)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this (ArgumentException):&lt;/P&gt;&lt;P&gt;pPropSet.SetProperties(pNames, pValues)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to deal with it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2019 11:01:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-write-multi-value-metadata-properties-using/m-p/442400#M12016</guid>
      <dc:creator>HagenProbsthain1</dc:creator>
      <dc:date>2019-08-14T11:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to write multi-value metadata properties using arcobjects?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-write-multi-value-metadata-properties-using/m-p/442401#M12017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, after I added the question, now I found a solution by myself.&lt;/P&gt;&lt;P&gt;There is a possibility to add an index to the name:&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/themeKeys/keyword[0]", "AAA")&lt;/P&gt;&lt;P&gt;pPropSet.SetProperty("dataIdInfo/themeKeys/keyword[1]", "BBB")&lt;/P&gt;&lt;P&gt;The result is what I want:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #007799;"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Tags:&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AAA, BBB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2019 11:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-write-multi-value-metadata-properties-using/m-p/442401#M12017</guid>
      <dc:creator>HagenProbsthain1</dc:creator>
      <dc:date>2019-08-14T11:54:36Z</dc:date>
    </item>
  </channel>
</rss>

