Solved

Reading different file format

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to the message 13 63
Help in WHSCRIPT 9 41
Use Multiple Forms 4 38
String manipulation in Visual Basic 7 45
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…
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…
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…

760 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

23 Experts available now in Live!

Get 1:1 Help Now