Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help please

1 view
Skip to first unread message

dw

unread,
Aug 28, 2007, 7:34:42 PM8/28/07
to
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


Greg Maxey

unread,
Aug 30, 2007, 3:22:27 AM8/30/07
to
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

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

0 new messages