Solved

Reading different file format

Posted on 1998-10-20
5
181 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

856 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