Hola!!!
El caso es que tengo un formulario q mediante un boton me abriría el documento word deseado y pasaría de una base de datos de access al documento unos campos.

El caso es que el código q tengo implementado me lo hace pero se me repiten los campos a lo largo de todo el documento.

Otro problema que tengo es que esos campos los quiero situar en el encabezado y pie de página tanto de la derecha como de izquierda y no se como es el código.

Alguna idea??? Os pongo el código q tengo hecho:

Private Sub Command1_Click()
Dim WordObj As New Word.Application
Dim paginas As Integer
Dim ruta As String
Dim oApp As Word.document
Dim Doc As Word.document


'Comenzar en nuevo documento
Me.CommonDialog1.ShowOpen
ruta = Me.CommonDialog1.FileName
Set oApp = WordObj.Documents.Open(ruta)
paginas = oApp.ComputeStatistics(wdStatisticPages)
Text3.Text = paginas
Set Doc = WordObj.Documents.Add


With Doc.MailMerge

'Insert the mail merge fields temporarily so that
'you can use the range containing the merge fields as a layout
'for your labels -- to use this as a layout, you can add it
'as an AutoText entry.





With .Fields
.Application.Selection.TypeText "Nº Cuestionario"
WordObj.Selection.TypeParagraph
.Add WordObj.Selection.Range, "numinicio"
WordObj.Selection.TypeParagraph
.Application.Selection.TypeText "Nº Cuestionario2"
WordObj.Selection.TypeParagraph
.Add WordObj.Selection.Range, "numfinal"
WordObj.Selection.TypeParagraph
.Application.Selection.TypeText "Nº Página"
WordObj.Selection.TypeParagraph
.Add WordObj.Selection.Range, "numpagina"
WordObj.Selection.TypeParagraph

End With
Dim oAutoText As Word.AutoTextEntry
Set oAutoText = WordObj.NormalTemplate.AutoTextEntries.Add("MyLabe lLayout", Doc.Content)
Doc.Content.Delete 'Merge fields in document no longer needed now
'that the AutoText entry for the label layout
'has been added so delete it.

'Set up the mail merge type as mailing labels and use
'a tab-delimited text file as the data source.
.MainDocumentType = wdMailingLabels
.OpenDataSource Name:="C:\Proyecto\Data.accdb" 'Specify your data source here

'Create the new document for the labels using the AutoText entry
'you added -- 5160 is the label number to use for this sample.
'You can specify the label number you want to use for the output
'in the Name argument.
WordObj.MailingLabel.CreateNewDocument Name:="1560", Address:="", _
AutoText:="MyLabelLayout", LaserTray:=wdPrinterManualFeed

'Execute the mail merge to generate the labels.
.Destination = wdSendToNewDocument
.Execute

'Delete the AutoText entry you added
oAutoText.Delete

End With

'Close the original document and make Word visible so that

'the mail merge results are displayed
Doc.Close False
WordObj.Visible = True

'Prevent save to Normal template when user exits Word
WordObj.NormalTemplate.Saved = True


End Sub