Desktop User Guides > Professional > Table scripting > Working with Change Tracker > Change Tracker: Modifying metadata in an existing Table Document
 
Change Tracker: Modifying metadata in an existing Table Document
Sample script file: ChangeTrackerTest2_OpenDocument.mrs
This example script is based on the Museum sample data set. See Running the sample table scripts for information on running the example scripts.
This example script demonstrates how to open a table document that includes change tracker records, how to modify metadata, and how to save the modifications to a table document file. The table document used in this example is created with the ChangeTrackerTest1_NewDocument.mrs script (see Change Tracker: Modifying metadata in a new table document).
The script produces the same tables as the ChangeTrackerTest1_NewDocument.mrs script (see Change Tracker: Modifying metadata in a new table document), as well as the following table:
Change tracker using the 'biology' field in Folder2
This graphic is described in the surrounding text.
The following script modifies the renames the expect field, creates a new folder, and moves the biology field into the new folder:
' Rename field
Set oField = MDMDoc.Fields["expect"]
ChangeTracker_RenameField(TableDoc, oField, "expect_new")

' Create folder
Dim oFolder
Set oFolder = ChangeTracker_CreateFolder(MDMDoc, "Folder2", 1)

' Move field to Folder2
Set oField = MDMDoc.Fields["biology"]
ChangeTracker_MoveFieldToFolder(MDMDoc, oFolder, oField)
See also
Working with Change Tracker