ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / Project Class / ImportMetadata Method / ImportMetadata(String,MDImportExportOption) Method
Example

In This Topic
    ImportMetadata(String,MDImportExportOption) Method
    In This Topic
    Import metadata. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Sub ImportMetadata( _
       ByVal catalogPathOrMDUri As String, _
       ByVal importType As MDImportExportOption _
    ) 
    public void ImportMetadata( 
       string catalogPathOrMDUri,
       MDImportExportOption importType
    )

    Parameters

    catalogPathOrMDUri
    importType
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Item: Updates metadata with the imported metadata - the input path can be the path to an item with metadata, or a URI to a XML file: ImportMetadata
    {
      // the input path can be the path to an item with metadata, or a URI to an XML file
      // Note: Needs QueuedTask to run
      metadataItemImport.ImportMetadata(@"E:\YellowStone.gdb\MyDataset\MyFeatureClass", MDImportExportOption.esriCurrentMetadataStyle);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also