Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

RichTextBox displays #@$%*&(

Posted on 2001-07-01
8
Medium Priority
?
391 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 150 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

609 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