We have a locked form with a macro button that inserts a fax cover sheet so we can electronically fax the form. However, we don't want the fax cover sheet saved with the document so our process is to use the macro to insert the cover sheet, then we fax it, then we close the document without saving changes. However, sometimes folks forget to close the file without saving the changes and they save it with the cover sheet attached. Then I have to go through them and remove the coversheets (because the form is password protected and I'm the 'holder of the keys'). Since I'm doing this over and over again I'm looking for a macro which will unlock the document, remove the first page, and then relock the document. With my limited knoledge of VBA, I've got:
Code: Select all
Sub FaxCoverRemover()
With ActiveDocument
' unprotect
If .ProtectionType <> wdNoProtection Then
.Unprotect Password:="password"
' remove the fax cover/first page
' reprotect
.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="password"
End With
End Sub
I just don't know how to write the codey piece in the middle that instructs, "select the first page and delete." Can someone help?
Thank you,
Dax