Imports System.IO
Imports System.Runtime.InteropServices
Module Example
Sub Main()
Dim objApplication As RevisionManager.Application = Nothing
Dim objDocument As RevisionManager.Document = Nothing
Dim objLinkedDocuments As RevisionManager.LinkedDocuments = Nothing
Dim objLinkedDocument As RevisionManager.Document = Nothing
Dim objAssemblyFileInfo As FileInfo
Dim objLinkedDocumentFileInfo As FileInfo
Try
objAssemblyFileInfo = New FileInfo("C:\Test\Asm1.asm")
objApplication = New RevisionManager.Application
objDocument = objApplication.Open(objAssemblyFileInfo.FullName)
objLinkedDocuments = objDocument.LinkedDocuments
For Each objLinkedDocument In objLinkedDocuments
' Get current path to linked document
objLinkedDocumentFileInfo = New FileInfo(objLinkedDocument.FullName)
' Change path to new location
objLinkedDocumentFileInfo = New FileInfo(Path.Combine("C:\Test\NewPath", objLinkedDocumentFileInfo.Name))
' Update link
Call objLinkedDocument.SetPath(objLinkedDocumentFileInfo.FullName)
Next
objDocument.SaveAllLinks()
objApplication.Quit()
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Sub
End Module