|
-
Jan 14th, 2000, 04:21 AM
#1
Thread Starter
Hyperactive Member
I would like to say thank you to everyone who responded to my recent posts. I have found what the problem was. It appears that the file was corrupt. It would look correct in Word but I cut and pasted the text into a new word doc and now it works like a champ.
My question for today is this. I want to add 15 small RTF files to a richtextbox. basically concatination one after another. When I use the loadfile method I loose the files loaded before it. How does one add several files together to make a complete document?
Thank you for your time and have a good day
------------------
I am so skeptacle, I can hardly believe it!
-
Jan 14th, 2000, 04:35 AM
#2
Hyperactive Member
would it work to dump the files into a variable and concatenate them and then load that into the textbox?
-
Jan 14th, 2000, 04:38 AM
#3
Just open the File(s) you want to append Manually and Add the RTF Data to the End of the RTF Text, ie.
Code:
Private Sub Command1_Click()
AppendRTF RichTextBox1, "C:\Files\test.rtf"
End Sub
Private Sub AppendRTF(ByRef oRTFBox As RichTextBox, ByVal sFile As String)
Dim iFile As Integer
Dim sChunk As String
Dim lChunk As Long
Dim lLOF As Long
Dim sFileData As String
On Error GoTo RTFAppendError
iFile = FreeFile
Open sFile For Binary Access Read As iFile
lLOF = LOF(iFile)
lChunk = 64000
While Loc(iFile) < lLOF
If lChunk + Loc(iFile) > lLOF Then lChunk = lLOF - Loc(iFile)
sChunk = Space$(lChunk)
Get #iFile, , sChunk
sFileData = sFileData & sChunk
Wend
oRTFBox.SelStart = Len(oRTFBox)
oRTFBox.SelRTF = sFileData
RTFAppendError:
Close iFile
If Err Then MsgBox "Error: " & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Error"
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 14th, 2000, 04:55 AM
#4
Thread Starter
Hyperactive Member
you da man!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|