Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merge word documents

Status
Not open for further replies.

michaenh

Programmer
Aug 7, 2002
205
NO
Hi all

Do anyone know how to merge a word document.
I have a standard word document with some merge fields and I want to merge these fields with some data from my database.

Any suggestions?

Best regards,
MHA
 
I use TRichedit with template where I put all data. Then you can get it to the clipboard or save as RTF. It is the easiest way if you do not want to dive into .doc format or OLE.
 
I will try that. Thank's alot December.. :eek:)

cheers,
Michael
 
I just woundering what is the big difference between a .rtf format and a .doc format?

Michael
 
RTF appears as a subset of .doc functionality. But biggest part of a .DOCument consists of RTF-blocks.
 
Thanks December!
It is nice to have responds (smile).

It is easy ,as you say, to use TRichedit with template where I put all data. Then to get it to the clipboard or save as RTF.

I am now trying to dive into doc. format or OLE.

Thanks alot once more....

Michael
 
If you want OLE information try Delphi's OLEAUTOMATION newsgroup. Lots of information there on using MSWord/Excel/Outlook through Delphi.

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Maybe something along these lines?

procedure MergeWordDocs(FileName1,FileName2:string);
var
WordObj:variant;
begin
WordObj:=CreateOleObject('Word.Basic');
WordObj.FileNew(FileName1);
WordObj.FileSaveAs(Name:=FileName1,Format:=0);
WordObj.FileOpen(FileName1);
WordObj.InsertFile(Name:=FileName2);
end;
 
Hi guys thank's for the tips.
I will try it out.

Its great to be here in this forum... everyone is so helpful.

I'll be back.. :eek:) with more problems.. :eek:)

After I have tried a little more...

michael
 
Just want to say that I have solved the problem..

Case closed. ;o)

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top