Solved

RichTextBox displays #@$%*&(

Posted on 2001-07-01
8
380 Views
Last Modified: 2008-03-06
Hi, I'm using a richtextbox to display a word doc that I'm using for help files in my database application.
I have tried to bring up the file as a txt file but it wont show the cross referencing for the links in the file, I tried it as a word doc and it shows it as a lot of gibberish, I've tried it sa a rtfFile but I get the same gibberish.
My form load code is
Private Sub Form_Load()
    Dim HelpFiles As Document
   
    'Call the word document to the rich text box
    rtfHelpFiles.LoadFile ("E:\Martial Arts Database\Martial Arts Database Help Files.rtf")
   
   
End Sub

It displays the rtfFile with all the links in blue very well at design time, but at run time its gibberish.

I'm still searching for a clue but would appreciate some help.
Reagards Ned
0
Comment
Question by:Ned_Kelly
  • 3
  • 2
  • 2
  • +1
8 Comments
 

Expert Comment

by:Lars
ID: 6242909
If you save it in Word as a RTF file and then open it in a RTF box there should be no problem.
You should use rtfHelpFiles.FileName c:.......
0
 

Accepted Solution

by:
Lars earned 50 total points
ID: 6242917
Just to  be correct rtfHelpFiles.FileName "E:\Martial Arts Database\Martial Arts Database Help Files.rtf"

0
 
LVL 3

Expert Comment

by:rmichels
ID: 6243031
The VB rich text control is based off of version 1.0 of the RTF windows control.  Word uses up to version 3.0 of the RTF spec.  You may have some control codes that are not supported in the VB control?
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6243607
As rmichels has pointed out, Rich text box control, supports, not all the control codes that are displayed in Word. But still you would be able to view the RTF file, with whatever codes, that the Rich text box, supports. If need be you could have a look at the control codes supported by VB Rich text box, in MSDN.

Do you load the file in design time or runtime? You have mentioned that it works in design time, but not in runtime?

Cheers.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Ned_Kelly
ID: 6244268
Thanks Lars, the end result was
rtfHelpFiles.LoadFile "E:\Martial Arts Database\Martial Arts Database Help Files.rtf"

I tried the .FileName but it kept coming up with an error.
I have taken out the brackets and it loads nicely now, though the crossreferencing in word doesn't work, I would have thought that it would enable cross referencing in the rtfbox, maybe its just me, but I can read my help files now though. Still a bit to do.

I didn't get a copy of MSDN with my copy of vis studio 6, it is registered and a legal copy but three cd's and no MSDN.

I'll do some searching on the net later.
Thanks everybody,
Regards Ned
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6244371
Ned,

Look at these links for help on RTF:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rtfbox98/html/vbconsupportedrtfcodes.asp
(Supported RTF Codes)

and

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rtfbox98/dt_vbconSupportedRtfCodesC.asp
(The methods/properties that were discussed and Rich Text box control links)

Hope this helps,
Cheers.
0
 

Author Comment

by:Ned_Kelly
ID: 6245297
Thanks to everybody for the comments, I'm going to accept Lars comment as the answer, because he sparked me to leave of the brackets, which led to the loading of a readable file.
Thanks to Valli An for the links, they have been bookmarked and files saved.
Hopefully one day I will be able to answer somebody's question and the tide will turn.
Regards Ned
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6245435
All the best, Ned.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now