Can Anyone help please, although this a word document I guess any VB expert can help.
I have a document with the following VB which simply copies & pastes the first document onto another page (different header).
Sub ADVICENOTE()
'
' ADVICENOTE Macro
' Macro recorded 22/03/2006 by XXXXXXXXX
'
Selection.WholeStory
Selection.Copy
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.InsertBreak Type:=wdPageBreak
Selection.PasteAndFormat (wdPasteDefault)
End Sub
The actual document I have changed so only certain fields can be filled in to make it idiot proof. As the document is protected when I use this function, the copy/paste macro will not run.
I have found the following code which unprotects a locked document, then allows changes to be made then relocks it.
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If
What I would like to know is can both be combined into 1 piece of VB code I can used as 1 macro, I have no idea. Please help!!
I have a document with the following VB which simply copies & pastes the first document onto another page (different header).
Sub ADVICENOTE()
'
' ADVICENOTE Macro
' Macro recorded 22/03/2006 by XXXXXXXXX
'
Selection.WholeStory
Selection.Copy
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.InsertBreak Type:=wdPageBreak
Selection.PasteAndFormat (wdPasteDefault)
End Sub
The actual document I have changed so only certain fields can be filled in to make it idiot proof. As the document is protected when I use this function, the copy/paste macro will not run.
I have found the following code which unprotects a locked document, then allows changes to be made then relocks it.
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If
What I would like to know is can both be combined into 1 piece of VB code I can used as 1 macro, I have no idea. Please help!!