Example: Duplicate a folder
This example creates a tag in a folder and then duplicates the folder.
Sub DuplicateTagDBFolder() On Error GoTo Err_Handler Dim oNewTag As Tag 'Create folders and tag. Set oNewTag = TagDB.CreateTag("Line1\Motor1\Speed", AnalogTag) 'Configure tag properties. oNewTag.Description = "Motor Speed." 'Save the tag configuration. oNewTag.WriteConfiguration 'Release resources associated with the tag object. Set oNewTag = Nothing 'Duplicate the Motor1 folder and its contents. TagDB.DuplicateFolder "Line1\Motor1", "Line1\Motor2" Exit Sub Err_Handler: 'Release resources associated with the tag object. Set oNewTag = Nothing MsgBox Err.Description, vbExclamation, "DuplicateFolder" End Sub
Provide Feedback