Solved

word file

Posted on 2000-04-17
11
138 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
  • 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 15

Accepted Solution

by:
simonet earned 400 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

16 Experts available now in Live!

Get 1:1 Help Now