Solved

Reading different file format

Posted on 1998-10-20
5
180 Views
Last Modified: 2010-04-30
Dear Experts,

     I have an application with a Richtextbox that reads files through common dialog "showopen".

     Rich Text boxes only support RTF and TXT file format. Assuming that every computer has got a Winword application software installed on it. How can I enable my VB application to read WinWord files? I do not want to use appactive to start winword. All I want is when the user choose a file(say winword) it will be opened in the Rich text Box(or is there other ways?). Do I need to purchase third party rendering software for it? If so how much would it cost and how good/stable is it?

     Or if someone can show me a working example I will extremely grateful(And increase the points to 100 too).

     Thanks!

Regards,
Dan
0
Comment
Question by:happydanny
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
idcanada earned 70 total points
ID: 1440891

Their is no need to increase points lads,
it simply can not be done.

RTF like WinWord has special codes that when displayed with the proper
engine, you get a certain result.

Like HTML, have a look at it with notepad, then with Netscape.

The only way you can do this and others have done for the past 6 years is
to put an OLE container.

User must have Winword for this to work though.

Have a look at the Vienna Project Group.
They have written a lightweight Document to replace the need for Microsoft Word 7.
Just register for the beta, source code is included.

Regards.
0
 

Author Comment

by:happydanny
ID: 1440892
Dear Expert,
     Is there a way at least to open winword(assuming the computer already has winword installed) in hidden mode(user can't see it) do a select all and copy, close winword and paste the content into the rich text box.
     To do all these without user actually interacting with winword? The user just select from the showopen commondialog box and everything else automated?

Regards,
Dan
0
 
LVL 4

Expert Comment

by:idcanada
ID: 1440893

As mentioned, but do understand your troubles,
for you to copy then paste the content with its rightful format would be impossible.
You would have to Prase and convert every formated code in order to replicate
what was in Winword.

RTF does not support tables, so that would come out all wrong.

Even then, I have just ran a test and WinWord does not copy its formated code,
it uses the GetText rather then GetFormat.

Here is the URL I forgot to include with my previous posting.
http://www.total.net/~idc/

Good Luck.

0
 

Author Comment

by:happydanny
ID: 1440894
Dear idcanada,

     If we just want to do that(copy the text) without caring whether the formatting code is properly converted or not(The user would have to delete whatever turns out to be garbabge when pasted in the Rich Text Box). What is the code necessary to achieve that? Must we use Windows APIs?
0
 
LVL 4

Expert Comment

by:idcanada
ID: 1440895

Well this is turning into another Question Danny.
But trust me, this is not what you want to do.

To come close to what you would like to do would be inserting an OLE Container.
Place one on a sample project, and then select Winword.

Another way would be to set your RTF Drag and Drop to Automatic,
try dropping a WinWord Document into it.





0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

809 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