S
spunkymuffmonkey
Hi.
I have a command button within my document that present users with a userform.
When this document is printed I have intercepted the print command with the
following so that the command button is not printed:
Sub FilePrint()
With ActiveDocument
If .ProtectionType <> wdNoProtection Then
.Unprotect Password:="Gatekeeper1"
End If
End With
ActiveDocument.InlineShapes(1).Delete
ActiveDocument.FormFields("Text13").Delete
Dialogs(wdDialogFilePrint).Show
ActiveDocument.Undo 3
ActiveDocument.Protect NoReset:=True, Password:="Gatekeeper1",
Type:=wdAllowOnlyFormFields
My problem is that when the deleted inlineshape is 'undone', it is
reinserted with an errant 1 on the end of the object name, for example
'CommandButton1' becomes 'CommandButton11', and I cannot find a way to
programatically change it back.
Any suggestions or help would be great.
Many thanks
I have a command button within my document that present users with a userform.
When this document is printed I have intercepted the print command with the
following so that the command button is not printed:
Sub FilePrint()
With ActiveDocument
If .ProtectionType <> wdNoProtection Then
.Unprotect Password:="Gatekeeper1"
End If
End With
ActiveDocument.InlineShapes(1).Delete
ActiveDocument.FormFields("Text13").Delete
Dialogs(wdDialogFilePrint).Show
ActiveDocument.Undo 3
ActiveDocument.Protect NoReset:=True, Password:="Gatekeeper1",
Type:=wdAllowOnlyFormFields
My problem is that when the deleted inlineshape is 'undone', it is
reinserted with an errant 1 on the end of the object name, for example
'CommandButton1' becomes 'CommandButton11', and I cannot find a way to
programatically change it back.
Any suggestions or help would be great.
Many thanks