?
Solved

word file

Posted on 2000-04-17
11
Medium Priority
?
145 Views
Last Modified: 2010-04-04
How can I open a word file in my application, edit a small word, and save the file to a database?
0
Comment
Question by:cando
[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
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2725136
You don't say if you want to edit the doc manually or via code, but either way you could use OLE automation to open and edit the word doc. (TOLEContainer). If you have D5, have a look at the word components on the 'servers' tab. For info about methods etc to use, have a good read through the relevent ???_TLB.pas files.
If you're using an Access DB, save the doc to an OLEObject field.

for good info on automation, have alook at http://www.djpate.freeserve.co.uk/Automation.htm
0
 

Author Comment

by:cando
ID: 2725198
the document would be edited via code. I would like the answer to to be non resource intensive and not add a whole lot of size to the file, but if i have to use ole, thats ok.
0
 

Author Comment

by:cando
ID: 2725201
the document would be edited via code. I would like the answer to to be non resource intensive and not add a whole lot of size to the file, but if i have to use ole, thats ok.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:mullet_attack
ID: 2725224
If you want to edit the word doc, I think you must use OLE (COM), unless when you say "edit a small word" you mean change ocurrance of word "Master" to "Mister" for example, you could probably do that at the binary file level. Using COM is not really resource intensive, however it does mean that the user must have word, and depending on what you are doing, starting and stopping Word may be a bit time-consuming.
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2725304
listenning
0
 
LVL 15

Accepted Solution

by:
simonet earned 1600 total points
ID: 2725407
Here's an "How-To" Project I wrote a while ago that does exactly that.

http://www.bhnet.com.br/~simonet/extras/oledb.zip

Full source code is included.

Yours,

Alex
0
 

Author Comment

by:cando
ID: 2729392
isn't there a way to do it without using ole?
0
 
LVL 15

Expert Comment

by:simonet
ID: 2729409
If you need in-place editing or displaying the file contents, the answer is "no".

If you simply want to manipulate the file outside your application, you can use The Automation objects, but that's still OLE.

Alex

0
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2730799
Yes you can do it without using OLE.

1. obtain full specification of MS Word document.
2. Write your own editor to use that specification.

I guess using OLE would be easier !

BTW, why the objection to using OLE (COM) ?  your PC is using multiple com servers etc every time you run Windoze.
eg Outlook has about 8 or 9 COM objects and virtually everything exporer does is com (via shell)...
0
 

Author Comment

by:cando
ID: 2733072
I dont really want to use ole because it is a client server application and not all of the computers would have word installed on them.
0
 
LVL 15

Expert Comment

by:simonet
ID: 2733121
Well, the solution is to keep ALL the Word files compatible with Word95, so you can use WordPad instead of Word to edit the files. WordPad comes with Windows, so it will cost you nothing, and can open/edit/save Word95 files.

Another option is to use RTF files, which would be a much simpler approach than using Word files. If it's up to you to decide, use RTF files instead . In that case you can simply use a TRichEdit, or get a TDBRichEdit from Delphi Super Page.

Yet another option is to use StarOffice on the computers that don't have MS Office. StartOffice word processor can edit Word97 files, but I don't know if StarOffice is OLE-enabled.

Other than the choices above, there's no way you can edit a Word file without having Word installed. Doing so would be against MS' EULA. Besides, if you can edit a Word file without Word, why would you need Word at all, to start with?

Yours,

Alex
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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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