Solved

Reading different file format

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

Technology Partners: 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!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

726 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