L
liakamai
Is there a way to make buttons invisible when a document is printing?
This code works to make my buttons invisible but I can't seem to get a
hold of the print event;
Sub ButtonsVisible(bNotVisible As Boolean)
Dim oShape As Word.InlineShape
' bVisible = False
For Each oShape In ActiveDocument.InlineShapes
If oShape.OLEFormat.ProgID = "Forms.CommandButton.1" Then
If bNotVisible Then
With oShape
With oShape
.Height = 1
.Width = 1
End With
End With
Else
With oShape
If .OLEFormat.Object.Caption = "X" Then
.Height = 21
.Width = 17.25
Else
.Height = 19.5
.Width = 48
End If
End With
End If
End If
Next
End Sub
This code works to make my buttons invisible but I can't seem to get a
hold of the print event;
Sub ButtonsVisible(bNotVisible As Boolean)
Dim oShape As Word.InlineShape
' bVisible = False
For Each oShape In ActiveDocument.InlineShapes
If oShape.OLEFormat.ProgID = "Forms.CommandButton.1" Then
If bNotVisible Then
With oShape
With oShape
.Height = 1
.Width = 1
End With
End With
Else
With oShape
If .OLEFormat.Object.Caption = "X" Then
.Height = 21
.Width = 17.25
Else
.Height = 19.5
.Width = 48
End If
End With
End If
End If
Next
End Sub