The 'Fill' macro will write the values to the document.e.g. from your document
Code:
Private Sub CommandButton2_Click() 'BOTON Limpiar'
Dim i As Long
Dim strNombre As String
For i = 1 To ActiveDocument.Bookmarks.Count
strNombre = ActiveDocument.Bookmarks(i).Name
Select Case strNombre
Case Is = "via"
Rellenar strNombre, cbovia.Value
Case Is = "kilometro"
Rellenar strNombre, txtpk.Text
Case Is = "partido"
Rellenar strNombre, "partido value"
Case Is = "termino"
Rellenar strNombre, "termino value"
End Select
Next i
lbl_Exit:
Exit Sub
End Sub
Note that you cannot fill a bookmark with nothing.
Or if you follow my suggestion and replace the bookmarks with content controls (
Insert Content Control Add-In will do that) then
Code:
Private Sub CommandButton2_Click() 'BOTON Limpiar'
Dim oCC As ContentControl
For Each oCC In ActiveDocument.ContentControls
Select Case oCC.Title
Case Is = "via"
oCC.rage.Text = cbovia.Value
Case Is = "kilometro"
oCC.Range.Text = txtpk.Text
Case Is = "partido"
oCC.Range.Text = "partido value"
Case Is = "termino"
oCC.Range.Text = "termino value"
End Select
Next oCC
lbl_Exit:
Set oCC = Nothing
Exit Sub
End Sub