Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a Macro to Bring Up MailMerge Find Record Option

Status
Not open for further replies.

LDickenson

IS-IT--Management
Jun 11, 2007
27
Hi

I have created a templated and I need to create a tooldbar shortcut that brings up a prompt to a user to enter some data for a field to equal i.e. index number and they type in 6 then the document merges to a new document.

Any help would be greatly appreciated.

Thanks,

Lisa
 
what have you tried so far ?

Chance,

Filmmaker, gentleman and ROMAN!
 
I have tried this and it does work but I am specifing an actual value that I want the field to equal here, when all I want is the Find in Field box to be displayed to the user.

RecentFiles(1).Open
ActiveDocument.MailMerge.DataSource.FindRecord FindText:="TZHeworkengine", _
Field:="HostName"
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
End Sub
 
An tried this butagain I am specifing what is in the field

ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM N:\catering.txt WHERE ((HostName = 'TZHeworkengine'))" & _
""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
End Sub
 
Have a look at the InputBox function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top