View Single Post
 
Old 12-15-2015, 06:00 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, you should be able to create a new document & populate the formfields using code like:
Code:
Dim wdApp As Object, wdDoc As Object
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If wdApp Is Nothing Then
  Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
With wdApp
  Set wdDoc = .Documents.Add("template path & name")
  With wdDoc
    .Formfields("EmployID").Result = Me.cboID.Value
    .Formfields("FName").Result = Me.txtFName.Value
    .Formfields("GName").Result = Me.txtGName.Value
    .Formfields("DOB").Result = Me.txtDOB.Value
  End With
End With
Formfields named as EmployID, FName, GName & DOB are assumed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote