View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Duncan[_5_] Duncan[_5_] is offline
external usenet poster
 
Posts: 290
Default Print number of copies box

Hello,

The following is some code that i put together to print out copies of a
merge after running a find to show the right one. maybe if you altered
this a bit you get it to do what you want? not sure mind, might be a
better way. (P.s im probly gonna get a caning for using the GoTo
command but then im not really much of a developer just a simple
bloke!) (P.s it loops until you press cancel)



ln18:
Documents("Test Merge TP1.doc").Activate
WordBasic.mailmergefindentry
Documents("Test Merge TP1.doc").Activate

' this lot is a message box to print it or not
Dim prompt, title, response
Dim style As Integer
prompt = "Would you like to print this TP1?
Yes = Print, No = Search again, Cancel = Close"
style = vbYesNoCancel + vbQuestion
title = "Print?"
response = MsgBox(prompt, style, title)
If response = vbYes Then
ActiveDocument.PrintOut
GoTo ln18
Else
If response = vbNo Then
GoTo ln18
Else
If response = vbCancel Then
ActiveDocument.Protect
wdAllowOnlyFormFields, no, ""
Documents("Test Merge TP1.doc").Close (no)
Documents("Print.doc").Activate

End If

End If

End If