Board index » delphi » Word 97 MailMerge using a Textfile
John Fraser
![]() Delphi Developer |
Mon, 28 Jan 2002 03:00:00 GMT
|
John Fraser
![]() Delphi Developer |
Mon, 28 Jan 2002 03:00:00 GMT
Word 97 MailMerge using a Textfile
I am using D4 trying to setup a Word 97 mail merge component.
I can do almost everything with regarding setting up an OLE automation to I'm using the following command to try to open the datasource WordApp.ActiveDocument.MailMerge.OpenDataSource('MrgData.txt',,True); If anyone knows what I'm doing wrong please help Regards John. |
Steve Mora
![]() Delphi Developer |
Mon, 28 Jan 2002 03:00:00 GMT
Re:Word 97 MailMerge using a TextfileExample of workable code: ........ var oleOpenFormat, oleTrue, oleFalse: oleVariant; begin ..... oleTrue := True; oleFalse := False; oleOpenFormat := wdOpenFormatText; WordDoc.MailMerge.OpenDatasource('MrgData.txt', oleOpenFormat, oleFalse, oleTrue, oleFalse, oleFalse, EmptyParam, EmptyParam, oleTrue, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam); WordDoc.MailMerge.Execute(oleTrue); ..... The parameters have to be local variables, type oleVariant. Steve QuoteJohn Fraser <jlfra...@bigpond.com> wrote in message Quote> I am using D4 trying to setup a Word 97 mail merge component. |
John Hedlef
![]() Delphi Developer |
Fri, 08 Feb 2002 03:00:00 GMT
Re:Word 97 MailMerge using a TextfileHere is a working example - I hope it helps. {************************************************************************** var begin try {Create an OLE Object} if OK then try {open the named text file AS the data OLEContainer.MailMergeOpenDataSource('H:\users\john\OLE_Example\FlatDB.txt' try try try try {OLE session terminated when OLEVariant destroyed} >I can do almost everything with regarding setting up an OLE automation to >I'm using the following command to try to open the datasource >WordApp.ActiveDocument.MailMerge.OpenDataSource('MrgData.txt',,True); >If anyone knows what I'm doing wrong please help >Regards >John. |
Michael Melle
![]() Delphi Developer |
Fri, 15 Feb 2002 03:00:00 GMT
Re:Word 97 MailMerge using a TextfileWarning: never use ''.txt''! Some Word configurations take it as DOS-text some as Windows-text (depends f.e. wether ODBC is installed or not, no chance to control, I had huge problems). Call your DataSource ''MrgData.abc" f.e. (every Word configuration will interprete it as Windows-text). Then use: op1 := WordApp.Options.ConfirmConversions; WordApp.Options.ConfirmConversions := false; WordApp.ActiveDocument.MailMerge.OpenDataSource(DataSource, 0, false, true, false); ... WordApp.Options.ConfirmConversions := op1; Regards John Fraser schrieb: Quote> I am using D4 trying to setup a Word 97 mail merge component. |
1. mailmerge word with office 97
2. Mailmerge to Word 97 - looking for better performance...
3. MailMerge in Word'97 via OLE-Automation
4. Use textfile as input for Word mailmerge
5. VCL : retrieve Word 97 doc properties without running Word 97
6. List of all Word.Basic commands for Word 97 AND Word 95
7. mailmerge using word and text files
8. can't create helpfile using Word 97