Showing results for 
Search instead for 
Did you mean: 

FindBrokenLinks Method - how to use ?

Valued Contributor
Valued Contributor


hallo all

I try to use FindBrokenLinks Method to obtain broken path. idea is get this path as string to varable.

but I don't know how to do it. one way is save summary log to file and next read this file...


when I obtain this broken path I can redefine in with new path through RedefineLink Method.

I'am new in visual Basic. can someone help me.


Posted by: Tibor
Post date: 4/11/2008 1:03:11 AM


RE: FindBrokenLinks Method - how to use ?

Valued Contributor
Valued Contributor


You didn't specify what version of VB you wanted.  This is example VB6 code to use the RevisionManager API to analyze links and repair them if necessary.Option ExplicitSub FixLinks() Dim objApplication As RevisionManager.Application Dim objDocument As RevisionManager.Document Dim objLinkedDocuments As RevisionManager.LinkedDocuments Dim objLinkedDocument As RevisionManager.Document Set objApplication = New RevisionManager.Application Set objDocument = objApplication.Open("C:\Asm1.asm") Set objLinkedDocuments = objDocument.LinkedDocuments For Each objLinkedDocument In objLinkedDocuments If (FileExists(objLinkedDocument.FullName) = False) Then Call objLinkedDocument.SetPath("NewPath") End If Next Call objDocument.SaveAllLinks Set objLinkedDocument = Nothing Set objLinkedDocuments = Nothing Set objDocument = Nothing Set objApplication = NothingEnd Sub' Return True if a file existsFunction FileExists(FileName As String) As Boolean On Error GoTo ErrorHandler ' get the attributes and ensure that it isn't a directory FileExists = (GetAttr(FileName) And vbDirectory) = 0ErrorHandler: ' if an error occurs, this function returns FalseEnd Function


Posted by: Jason Newell
Post date: 4/16/2008 8:05:50 PM