Hi All,
I have a mail merge set up between an excel doc and a word doc. I would like to use the excel info to populate the word document, but want to be able to select which row to populate it with. I have the mail merge set up, and I have a macro written to create an Input Box asking for a Booking Number which will then pull over the relevant info. It works, but only for the first row of the excel document and I'm not sure why that is. Below is the macro I presently have written
Sub invoice()
Dim dsMain As MailMergeDataSource
Dim numRecord As Integer
Dim myBooking As String
myBooking = InputBox("Enter the value:")
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = False
Set dsMain = ActiveDocument.MailMerge.DataSource
If dsMain.FindRecord(FindText:="myBooking", Field:="BookingNo") = True Then
numRecord = dsMain.ActiveRecord
End If
End Sub
Bookmarks