Reply

SetActionInRevisionManager problem

Hello, I'm trying to change a connection between a dft file to a psm file. (It's already connected to a psm file, I just want to replace it).

 

I'm trying to use it through the code - 

var RevApplication = new RevisionManager.Application();
RevisionManager.Document doc = RevApplication.Open(path);
RevApplication.SetActionForAllFilesInRevisionManager(RevisionManagerAction.ReplaceAllAction, @"D:\directory\filename.psm");
RevApplication.PerformActionInRevisionManager();
RevApplication.Quit();

 

unfortunately nothing happens.

How am I supposed to change the connection between the dft file and the related psm? What am I doing wrong?

 

Thanks.

1 REPLY

Re: SetActionInRevisionManager problem

You should try something like this, it works for me :

 

     Public Sub Change_DFT_Source(ByVal DFTFile As String, ByVal OldSourceFile As String, ByVal NewSourceFile As String)

        Dim ObjApp As RevisionManager.Application
        Dim ObjDocument As RevisionManager.Document
        Dim ObjLinkedDocuments As RevisionManager.LinkedDocuments

        ObjApp = CreateObject("RevisionManager.Application")
        ObjDocument = ObjApp.OpenFileInRevisionManager(DFTFile)
        ObjLinkedDocuments = ObjDocument.LinkedDocuments(RevisionManager.LinkTypeConstants.seLinkTypeAll)
        For Each ObjOcc In ObjLinkedDocuments
            If ObjOcc.fullname = OldSourceFile Then
                ObjOcc.Replace(NewSourceFile)
            End If
        Next
        ObjApp.PerformActionInRevisionManager()
    End Sub


Romuald BERTIN