Solved

RichTextBox displays #@$%*&(

Posted on 2001-07-01
8
378 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

758 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

17 Experts available now in Live!

Get 1:1 Help Now