Languages :: Java :: doc files |
|||
| By: progGoon |
Date: 22/05/2003 00:00:00 |
Points: 50 | Status: Answered Quality : Excellent |
|
how i display doc files in textbox or richtextbox? or i want to see a prievew of doc,ppt,or excel file when i click them. |
|||
| By: VGR | Date: 22/05/2003 21:50:00 | Type : Answer |
|
| you can't. The DOC files should be RTF files in fact. A RTF file may be renamed ".DOC" with no problem for Word, and a RTF file is displayable in a richtextbox |
|||
| By: DaMann | Date: 22/05/2003 22:36:00 | Type : Comment |
|
| Sub POLISHER() 'How to read a text file into a text box. '----- ' Here's how to read a text file into a text box control in one gulp. Dim FileName As String Dim f As Integer FileName = "c:\bpcspc\polisher.txt" f = FreeFile 'Get a file handle Open FileName For Input As f 'Open the file TextBox1.Text = Input$(LOF(f), f) 'Read entire file into text box Close f 'Close the file. End Sub This is a working method. |
|||
| By: digitaltree | Date: 22/05/2003 23:14:00 | Type : Comment |
|
| DaMann that will not work for doc files because they are not entirely ascii files. They also consist of a lot of binary data because of the formatting that word does. To pull it in to a textbox or richtextbox you would have to first open the doc file and scan through it for any ascii values and pull each successful find into another virtual file then display that file in the text/richtextbox. I'll see if I can dig up any of my old code on this later when I'm back on my machine instead of here at work. |
|||
| By: DaMann | Date: 22/05/2003 23:25:00 | Type : Comment |
|
| you are correct, i miss read. thought was refering to a text file, My apolligies. DaMann |
|||
| By: kimbaz | Date: 11/06/2003 21:15:00 | Type : Comment |
|
| Mmm convert a Word document to text file is quite complex... You can do this. Add an OLE object to your project. Then you by code load your doc, excel, or power-point in your ole object. To edit it use this code: 'After load document OLE1.Verb=-5 OLE1.Action=7 'To save you Word document to a file: OLE1.object.SaveAs "C:\temp.doc" 'To close the document OLE1.Action=9 Check if after this command all word session are close Sorry for my bad english... |
|||
|
Do register to be able to answer |
|||
©2012 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








