|
-
Mar 13th, 2002, 07:46 AM
#1
Thread Starter
Frenzied Member
-
Mar 13th, 2002, 07:52 AM
#2
Fanatic Member
Use the selstart
Like
rtf1.selstart = 10 'want to start at the 10 character
rtf1.sellength = 5 'take 5 characters
rtf1.selbold = True 'only make this 5 characters bold
Hope it helps
-
Mar 13th, 2002, 08:11 AM
#3
Lively Member
the formatting caps of the RTFBox refer to the currently selected (-->highlighted) parts of the text. Thus, you have to set SelStart and SelLength according to your requirements and then
Code:
with RTFBox1
.SelStart=138 'Start Selection at Character 138)
.SelLength=10 'Length of selected Substring=10
.SelBold=True 'Make Selection Bold
.SelUnderline=True 'Underline the stuff
end with
Same goes with Fontsize, Font, Color, Italics etc..
Then save everything using RTFBox1.Savefile "C:\FILENAME.RTF",0
Hope that finally helps, since this is your 3.attempt or so?
-
Mar 13th, 2002, 09:50 AM
#4
Thread Starter
Frenzied Member
My problem is I dont' know how many characters or lines there will be. I am reading the data from an external file, and looping through it until EOF is reached.
Forget it, I'll find another way around it.
Thanks anyway.
-
Mar 13th, 2002, 10:27 AM
#5
Lively Member
If you are reading data, like from a data base, and either the strings end with CRLF or you have some other possibility of identifying the end of a record, then you should be able to do your formatting line-by-line or string-by-string. You have to keep track of the number of characters already written, then you could set selstart and length accordingly.
Another workaround comes to mind (albeit a bit dirty):
Read your data, put a full record into another (small, temorary) RTFBox, do your formatting and add the contents to the final RTFBox. Just set .Visible to False and no one 'll ever find out.
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
|