You can give a try of code in below article:
http://www.codeproject.com/Articles/19856/Windows-Application-for-Merging-Text-Files
if it does not work, you also can use a convert your text to word and merge word files into one , then, extract word text, even it is not a direct method, but the code is really very simple:
save text as word:
Dim mydoc As New Document()
mydoc.LoadFromFile("D:\michelle\text2doc.txt")
mydoc.SaveToFile("result0.doc", FileFormat.Doc)
merge word files:
Dim fileName As String = OpenFile()
Dim fileMerge As String = OpenFile()
If ((Not String.IsNullOrEmpty(fileName))) AndAlso ((Not String.IsNullOrEmpty(fileMerge))) Then
'Create word document
Dim document_Renamed As New Document()
document_Renamed.LoadFromFile(fileName,FileFormat.Doc)
Dim documentMerge As New Document()
documentMerge.LoadFromFile(fileMerge, FileFormat.Doc)
For Each sec As Section In documentMerge.Sections
document_Renamed.Sections.Add(sec.Clone())
Next sec
Details of merge word files can be seen:
http://everlasting129.weebly.com/1/post/2012/1/word-merge-for-c-vbnet.html
extarct word text:
'new a stringBuilder to extract text from word document
Dim sb As New StringBuilder()
'extract text from word document
For Each section As Section In doc.Sections
For Each paragraph As Paragraph In section.Paragraphs
sb.AppendLine(paragraph.Text)
Next
Next
Method two is suitable when you can not find a direct method to merge text files with vb.net
Never give up! Smile to the world!
http://excelcsharp.blog.com/
Stevelk, if this helps please login to Mark As Answer. | Alert Moderator