Read MS Word Doc into A Memo Field

how can I read a MS word document into a memo field.

I am using the scalbium component, which works mostly, hence i am seeking an alternative method that works all the time.

Thanks in advance.

LVL 1
delphinewbieAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheLeaderCommented:
good page FAQ Delphi/MSWord
http://www.softmosis.ca/WordFAQ.html#GetData
0
delphinewbieAuthor Commented:
Scalabium have made available an update to their component that works on 854 of 855 tested documents.

I will still award points if I am provided with a working solution, not a link to a web page that talks in general about the topic and other MS products.

Although I do appreciate assistance through this forum, I can do google searches myself.
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

GloomyFriarCommented:
...
wd: TWordDocument;
wa: TWordApplication;
...

 Memo1.Clear;
  FileName := 'c:\temp.doc';
  wa.Connect;
  wa.Documents.Open(FileName, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
                    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam
  );
  wa.Visible := True;
  wd.ConnectTo(wa.ActiveDocument);
  wd.Select;
  Memo1.Lines.Add(wd.Range.Text);
  wa.Visible := False;
  wa.Disconnect;
0
delphinewbieAuthor Commented:
I assume uses word97 is required.

tried this but it crashes at:

wa.Documents.Open(MyFileName, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam);
 
I removed the EmptyParam code and left it blank.

Error - "types of actual and var parameters must be identical"

thanks for your help.


0
GloomyFriarCommented:
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Word97, OleServer, ComObj, Variants;

The sample was checked under Delphi7 with Word2002.
0
GloomyFriarCommented:
Just create an empty project and put 2 components (TWordApplication and TWordDocument) on the form.
0
delphinewbieAuthor Commented:
Appologies for the delay in responding -

Same error message  - same line.

I use delphi6 with word 2002
0
GloomyFriarCommented:
I've checked. It works fine under Delphi6.
May be you've fogotten to create test file "c:\temp.doc"
Create the file with some text ("Test string" for example).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
delphinewbieAuthor Commented:
Although the supplied code does not work on my pc.
Points awarded for trying.
Cheers
Brad
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.