?
Solved

Opening ms. word files

Posted on 2000-05-06
5
Medium Priority
?
152 Views
Last Modified: 2010-04-30
Who can explain me how to open a msword file in my programm, that includes also the text in its word form.



please give me some code.



i have a text field : text1
0
Comment
Question by:markyvt
[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
  • 2
  • 2
5 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 2785354
I know of 2 things, but you won't be able to display the formatted text in your text box, you would need richtextbox...

1=Office Automation
 Check Microsoft Word in Project References
 Sub GetWordData
   DIM appWord as Word.Application
   DIM objDocument as Word.Document

   SET appWord = NEW Word.Application
   SET objDocument = appWord.Documents.Open ("C:\Mydoc.Doc")

   text1.Text = objDocument.Range.Text
   objDocument.Close
   SET objDocument = NOTHING
   appWord.Quit
   SET appWord = NOTHING
 End Sub


2=Webbrowser Control (to display Word Document inside of your application)
 Check Microsoft Internet Controls in Project Components
 Add Webbrowser Control to your form (with name "webBrowser")
 Sub OpenDoc(Path as string)
   webBrowser.NavigateTo Path
 End Sub

Hope this helps


0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2785393
even a richtextbox doesnt potentially handle all the formatting of a ms word document.  for this you should save the word file as a temporary text file, and then read that text file into your textbox.

How to translate a word doc to txt file:
http://www.vb-helper.com/Howto/word2txt.zip
0
 
LVL 2

Author Comment

by:markyvt
ID: 2794084
From: AzraSound
 Date: Sunday, May 07 2000 - 10:56AM CEST  
even a richtextbox doesnt potentially handle all the formatting of a ms word document.  for this you should save the word file as a temporary text file, and then read that text file into your textbox.

How to translate a word doc to txt file:
http://www.vb-helper.com/Howto/word2txt.zip

 

Thanks Azrasound but the webbrowser component does enough for me, to bad i could'nt give you also some points.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2794102
sorry i thought you were trying to read the document's text into a textbox
0
 
LVL 2

Author Comment

by:markyvt
ID: 2794246
I was but the other thing worked out better,

sorry,.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses

718 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