Solved

Reading different file format

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

911 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