Solved

RichTextBox displays #@$%*&(

Posted on 2001-07-01
8
385 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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
 

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

690 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