Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rtfText loading files

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
Does anyone know how to load the contents of a variable into an rtfText control? i.e. if you have loaded an rtf file into a variable:

open rtffile for input as #1
do until eof(1)
line input #1 templine
alltext = alltext & templine
loop

and then did any modifications to alltext you wanted, can you send alltext to the rtfText box without saving alltext in a file?
 

hi,

what about
RichTextBox1.TextRTF = MyString

-by the way
--------------------------------------------------
infile=freefile
open rtffile for binary as #infile
MyString=string(lof(infile)," ")
Get #infile, 1, MyString
Close #infile
------------------------------------------------
is faster

Sunaj
 
OK, The load bit works.
The binary method of opening the file doesn't work though, did I mistype something?
 
Hi,

I've tested this and it works (for me). It should also work fine for you:
---------------------------------------------------------
Dim InFile As Byte, MyString As String
InFile = FreeFile
Open "c:\tmp\test.txt" For Binary As #InFile
MyString = String(LOF(InFile), " ")
Get #InFile, 1, MyString
Close #InFile
----------------------------------------------------------


Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top