Security is one of the key reasons why do professionals choose PDF files to share and store information. PDFs will appear the same, regardless of whether you open them on a Mac, a Microsoft one or use a smartphone. You can open them on whatever device you have, and they will be readable the same way. The PDF is a popular file format used in business, thanks to the availability. This shortens the line and allows the text to be displayed without scrolling left/right.Lock Header Form: edit PDF documents from anywhere ' to find out where the user is in the document.
#LOCK HEADER AND FOOTER IN WORD CODE#
The long comment in Marcster's code window should be something like: It is simple thing to do, and it makes it easier for the rest of us.
I know I am being a PITA, but there you go. In other words, preventing access to the header is NOT the issue - the format of the header is the issue, and can be dealt with.įinally (really), again, would people please use the underscore character in the VBA code window? I would really appreciate it. You can make it revert to the standard format. At that level it is irrelevant whether the user changes anything, or not. If the requirements are, in fact, to ensure the document is maintained with a standard format.then deal with it at that level. This way there is no selection made, it just uses the Range.įinally (almost) I must point out that this is a good example of finding out real requirements. Otherwise you would have to actually select the header. It is handy to ensure partial formatting is cleared. Note that Clearformatting is not available in Word 97 or (I think) 2000. But if they SAVE the file.the headers will be changed into the "standard format".įor Each oSection In ActiveDocument.Sections() The users can make all the format changes they want.
If you put the following into the FileSave routine it will ALWAYS make sure the headers have the correct style. Say you have a corporate style for headers - CorpHeader. In which case, if styles are being used (and they should), then you CAN enforce format. Otherwise "standard format" is a meaningless term. I would also like to point out that if there IS a standard format then styles should be used. The Marcster's Selection View code would not even run. Would make the Primary header of Section 1 40 point, bold with the text "Na-na-na-na". With ActiveDocument.Sections(1).Headers(1).Range
Well, you can.but it takes a bit more code than that. You can slow them down, but you can't stop them. I would also like to point out that it prevents everyone from doing so. All it does is prevent going into the window. That certainly does NOT stop anyone from directly accessing headers or footers by VBA. You need to paste the above in the ThisDocument module. MsgBox "Headers and footers are disabled in this document.", vbCritical, "Action Cancelled" 'Using "" to find out where the user is in the document. 'Do not allow user to be in the header or footer of document. Private Sub objWord_WindowSelectionChange(ByVal Sel As Selection) 'Set variable objWord to active document in order for the events to be captured. Private WithEvents objWord As Word.Application