ConcatenateTwoTextFiles

Description: Places the sSourceFile text at the end of sTargetFile.

Parameters:

ConcatenateTwoTextFiles(sSourceFile As String, sTargetFile As String) As Long

Parameter

Meaning

SSourceFile

This file will be added to the end of sTargetFile

STargetFile

Location where sSourceFile will be added; at the end of sTargetFile

Return Values:

0: Success

-2: Unable to open original file

-3: Unable to open target file

-201: "Shareware has expired" 

Example Code:

The code below is taken from the sample VB program provided. It demonstrates both the ConcatenateTwoTextFiles() and DeleteEmptyLinesFromTextFile methods.

Private Function PerformTextSpecialProcess(lngProcess As Long, _

strSourceFile As String, _

strTargetFile As String) _

As Long

Dim lngResult As Long

Select Case (lngProcess) 'choose which of the processes to execute

    'then call the component

Case SP_CONCATENATE_TEXT_FILES

lngResult = XLSConv1.ConcatenateTwoTextFiles(strSourceFile,

strTargetFile)

Case SP_REMOVE_EMPTY_LINES_FROM_TEXT_FILE

lngResult = XLSConv1.DeleteEmptyLinesFromTextFile _

(strSourceFile, strTargetFile)

End Select

If (lngResult = 0) Then 'checks that a file was created using the

    'helper function, FileExists

If (FileExists(strTargetFile) = False) Then 

lngResult = -100

End If

End If

Select Case (lngResult) 'if error, display appropriate message

Case -1

strErr = "Unable to Complete Requested Process"

Case -100

strErr = "File does not exist."

End Select

PerformTextSpecialProcess = lngResult

End Function