|
DigiPara Liftdesigner LDX API
|
API method: ILDXDocument5.Replace
' from Samples/Src/LDXAPIExamples/Example_LDXDocument.vb
<APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc, APIHelpModes.InputParaDesktopWithOtherFileName, "API example report template.txt", APIHelpModes.InputParaDesktopWithOtherFileName, "API example report.txt"}, "", "LDXDocument~Replace", "Generate report")>
Public Shared Sub GenerateReport(ldxDocument As DigiPara.LDX.LDXDocument, sourceFilePath As String, targetFilePath As String)
If ldxDocument Is Nothing Then
MsgBox("Active document not found!")
Exit Sub
End If
If Not System.IO.File.Exists(sourceFilePath) Then
MsgBox("The report template " + sourceFilePath + " does not exist!")
Exit Sub
End If
ldxDocument.Replace(sourceFilePath, targetFilePath)
Try
System.Diagnostics.Process.Start(sourceFilePath)
System.Diagnostics.Process.Start(targetFilePath)
Catch
End Try
End Sub