tca_VB
09-26-2008, 12:06 PM
I have a command button that when clicked runs some code...
It worked fine until I worked on trying to position it in the bottom right corner with a full document of text. The goal was also to have it not shown when printing.
So, to accomplish the positioning and no show when print, I read and tried to set the control to In Front of Text.
Using In Front of Text and the following code for FilePrint accomplished the placement and no show when print - BUT - when can no longer click the button to run the code.
**FYI - this button is on a form field template that is form protected, not sure if that helps/hurts. **
Here is the code of the fileprint - again works fine if I use In Front of Text, but then the command button doesn't run it's code on click. It takes me back to the first form field.
Sub FilePrint()
'
' FilePrint Macro
Dim myShape As Shape
With ActiveDocument
For Each myShape In .Shapes
myShape.Visible = msoFalse
Next myShape
End With
ActiveDocument.PrintOut
End Sub
Thanks
It worked fine until I worked on trying to position it in the bottom right corner with a full document of text. The goal was also to have it not shown when printing.
So, to accomplish the positioning and no show when print, I read and tried to set the control to In Front of Text.
Using In Front of Text and the following code for FilePrint accomplished the placement and no show when print - BUT - when can no longer click the button to run the code.
**FYI - this button is on a form field template that is form protected, not sure if that helps/hurts. **
Here is the code of the fileprint - again works fine if I use In Front of Text, but then the command button doesn't run it's code on click. It takes me back to the first form field.
Sub FilePrint()
'
' FilePrint Macro
Dim myShape As Shape
With ActiveDocument
For Each myShape In .Shapes
myShape.Visible = msoFalse
Next myShape
End With
ActiveDocument.PrintOut
End Sub
Thanks