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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sendkeys to word fileprint dialogbox?

Status
Not open for further replies.

excellover

Technical User
Nov 15, 2002
10
CA
or other dialog box?
thanks
 
See below for an example. But, what exactly do you want to do? If you want to control printing, you can do that without showing the user a dialog. On the other hand, if you want to give the user limited choices, you can use your own custom dialog for that and then execute the print method.

Option Explicit
Sub test()

Dim MyDialog As Dialog
Dim Request As Integer

Set MyDialog = Dialogs(wdDialogFilePrint)
MyDialog.NumCopies = 3
MyDialog.Pages = "1-3,6-10"
Request = MyDialog.Display '(Use .Show to allow execute)

If Request = -1 Then
MsgBox ("User said print")
Else
MsgBox ("User said Cancel")
End If

Set MyDialog = Nothing

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top