Help please

D

dw

I'm really hoping someone can offer a solution for this because it's kicking
my butt.

I have a Word 2003 form. It includes tables, fields, a few image files, a
few drawing objects.

I need to give it to my customers so that it is a protected form, allowing
them to only fill in the fields. Once the fields are filled in, they will
print the completed form.

I need to provide a command button to reset all of the form fields to their
initial value. And here comes the part that is kicking my butt - I need to
have the "Reset" button NOT appear on the printed page.

Is there some easy way that I'm missing to tell Word to display the button,
to react tot he button's click event, but to NOT print the button?

Help please!

dw
 
G

Greg Maxey

dw,

Thanks to Helmut Weber, you might try:

Option Explicit
Public Sub FilePrint()
' intercepts File > Print (Ctrl+P)
HideResetCommand
Dialogs(wdDialogFilePrint).Show
ShowResetCommand
End Sub
Public Sub FilePrintDefault()
' intercepts Print button
HideResetCommand
ActiveDocument.PrintOut Background:=True
ShowResetCommand
End Sub
Public Sub FilePrintPreview()
HideResetCommand
ActiveDocument.PrintPreview
End Sub
Public Sub ClosePreview()
ActiveDocument.ClosePrintPreview
ShowResetCommand
End Sub
Sub HideResetCommand()
Dim oCtr
Set oCtr = ActiveDocument.Shapes(1)
oCtr.OLEFormat.Object.Caption = ""
oCtr.Width = 0
oCtr.Height = 0
End Sub
Sub ShowResetCommand()
Dim oCtr
Set oCtr = ActiveDocument.Shapes(1)
oCtr.OLEFormat.Object.Caption = "Reset Form"
oCtr.LockAspectRatio = msoFalse
oCtr.Height = 24
oCtr.Width = 72
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top