D
Dietmar
Hello,
Word 2002
I have made a macro which makes a mail merge. Each letter is saved
seperately in a different file. Additionately the macro should edit
the datasource and add for each line the full path of the document.
The datasource is linked to Word via "Microsoft Excel Worksheet via
Converter". This enables me to use the Edit function of Mail Merge
Recipients. There is no problem changing the datasource manually.
However I had some problems to do it via VBA.
I found the EditDataSource Methode. This works but I can only change
the data via Word. Word opens The Excel Datasource and changes the
datas. That means that I cannot open the datasource in Excel (File
Format is not valid). Word obviously saves the file with a code which
makes the whole unusable for Excel. Moreover to edit datas with this
method is very unsave because I have no key in my Excel file. I would
prefer this methode:
Mail1 = Documents("Serienbrief3").MailMerge.DataSource.DataFields.Item(11)
Unfortunately this is a read only method. I have also tried to use the
Macro recorder (Mail Merge Recipients/Edit) but the Macro recorder
does not record anything. I think Word does something with SQL.
So my question is there a way to edit the datasource via VBA in Word
without the EditDataSource Methode? Any help is appreciated.
Dietmar
Word 2002
I have made a macro which makes a mail merge. Each letter is saved
seperately in a different file. Additionately the macro should edit
the datasource and add for each line the full path of the document.
The datasource is linked to Word via "Microsoft Excel Worksheet via
Converter". This enables me to use the Edit function of Mail Merge
Recipients. There is no problem changing the datasource manually.
However I had some problems to do it via VBA.
I found the EditDataSource Methode. This works but I can only change
the data via Word. Word opens The Excel Datasource and changes the
datas. That means that I cannot open the datasource in Excel (File
Format is not valid). Word obviously saves the file with a code which
makes the whole unusable for Excel. Moreover to edit datas with this
method is very unsave because I have no key in my Excel file. I would
prefer this methode:
Mail1 = Documents("Serienbrief3").MailMerge.DataSource.DataFields.Item(11)
Unfortunately this is a read only method. I have also tried to use the
Macro recorder (Mail Merge Recipients/Edit) but the Macro recorder
does not record anything. I think Word does something with SQL.
So my question is there a way to edit the datasource via VBA in Word
without the EditDataSource Methode? Any help is appreciated.
Dietmar