Problem with RenameFiles Method

Valued Contributor
Valued Contributor

Hi,

 

I make this sample code to rename assembly file but my Asm file does not change after this action with the Revision Manager.

 

You have any idea?

 

My C# code:

 

RevisionManager.Application objApplication = null;

RevisionManager.Insight objInsight = null;

object filesToBeRenamed = null;

object destinationPathsOfRenamedFiles = null;

 

 

// Start Revision Manager.

objApplication = new RevisionManager.Application();

// Get reference to Insight object.

objInsight = (Insight)objApplication.Insight;

 

filesToBeRenamed = "\\\\MyLocal\\Assembly" + "\\" + "Part14.asm";

destinationPathsOfRenamedFiles = "\\\\MyLocal\\Assembly" + "\\"+"Part14.asm" + "1";

 

objInsight.RenameFiles(filesToBeRenamed, destinationPathsOfRenamedFiles);

 

//I have Pop up here from Revision Manager:

//With confirmation The folder already contains a document named Part14.asm1

//But I don't have this file Part14.asm1 in the folder \\\\MyLocal\\Assembly

//Look the attach file for more information.

 

Same with VB.Net

 

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

Dim objApplication As RevisionManager.Application = Nothing

Dim objInsight As RevisionManager.Insight = Nothing

Dim FilesToBeRenamed As Object

Dim DestinationPathsOfRenamedFiles As Object

 

Try

' Start Revision Manager.

objApplication = New RevisionManager.Application

 

' Get reference to Insight object.

objInsight = objApplication.Insight

 

FilesToBeRenamed = "C:\Assembly" + "\" + "Part14.asm"

DestinationPathsOfRenamedFiles = "C:\Assembly" + "\" + "Part11.asm"

 

objInsight.RenameFiles(FilesToBeRenamed, DestinationPathsOfRenamedFiles)

 

Catch ex As Exception

' Write any errors to console.

Console.WriteLine(ex.Message)

Finally

' Release COM Objects.

If Not (objInsight Is Nothing) Then

Marshal.ReleaseComObject(objInsight)

objInsight = Nothing

End If

 

If Not (objApplication Is Nothing) Then

objApplication.Quit()

Marshal.ReleaseComObject(objApplication)

objApplication = Nothing

End If

End Try

End Sub

End Class

 

Thank you.

 

Posted by: Norber
Post date: 9/25/2013 10:01:50 AM