I assume that when you say "user only has to select the concerned txt file
in a form", you mean that when the user has the Label type mailmerge main
document open, they only have to select the data source by using something
like the file open dialog.
If that is the case, the following will probably do what you want, though
you may have to alter the text that is being inserted into the text document
so that the field names and the separators are appropriate for your
situation:
Dim opened As Boolean
Dim maindoc As Document, source As Document
Dim sourcename As String
Set maindoc = ActiveDocument
If maindoc.MailMerge.MainDocumentType <> wdMailingLabels Then
MsgBox "The active document is not a label type mailmerge main
document."
Exit Sub
End If
opened = Dialogs(wdDialogFileOpen).Show
If opened = False Then
MsgBox "You pressed cancel."
Exit Sub
End If
Set source = ActiveDocument
sourcename = source.FullName
If UCase(Right(sourcename, 3)) <> "TXT" Then
MsgBox "The file that you opened is not a text file."
Exit Sub
End If
source.Range.InsertBefore "first,last,address,city,postcode" & vbCr
'modification may be required
source.Save
source.Close
With maindoc.MailMerge
.OpenDataSource Name:=sourcename
.Destination = wdSendToPrinter
.Execute
End With

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hello,
> I am working on the following project:
[quoted text clipped - 9 lines]
>
> Greeting, Johannes
Johannes Schmitz - 25 Mar 2006 18:09 GMT
Thank you, I will try this and ask if I need more help.
Johannes
Johannes Schmitz - 25 Mar 2006 18:22 GMT
I tried to run the code but i get an error. (in Line 4, something with
Procedure) Can you explain me what i have to do in order to run this?
Johannes
Johannes Schmitz - 25 Mar 2006 18:51 GMT
Ok, finally I got it running.
My next question is if it is possible to save the txt file as an excel file
inside the makro. And than use the excel file as Datasource.
Johannes