Then click to turn off the Link to Previous option under the Design tab. Set docCrnt = (asFiles(lFile))ĭocCrnt.Windows(1).View. Double click the header or footer section in page 2 to enable the header or footer editing mode. Here is a very trivial example: Public Sub Example() You could just put the header data in a text file and pull it in.
#HOW TO CHANGE HEADER IN WORD DOCUMENT 2007 CODE#
Unless I thought I could gain more time then I was going to lose writing code to alter the documents directly I would probably just loop through all the file in the folder, open them and alter them. The second would be to figure out the binary format (which is documented) and alter it using the VB6/VBA native binary IO (very non-trivial). Then, with revision tracking in effect, if you select Simple Markup, only 'change bars' will appear. The first is to open the file via vba and alter the header via the document object model. Click on the dialog launcher in the Tracking Section of the Review tab of the ribbon and then on Advanced Options and if all that you want to appear are 'change bars', select None for both Insertions and Deletions. (Or any of the dozens of other ways to alter what is essentially a text file.) If the file(s) are still in the binary format you really only have one of two options. Also verify, each control is marked as Allow under Permissions. I found a program that I would kick off when I left in the evenings that would open up all of our Policy and Procedure Word Documents and replace the header with the one in a file that I selected. Switch to Security tab and check file usage rights is given in Group or usernames. Years ago when I first started working for this company we had just undergone a change of ownership and a change in business name.
Click on Properties and uncheck Read-only. It's in the 'Header & Footer' section that's on the right side of the row of options near the top of the screen. First if the documents are saved in the office XML format then you could open the files using the MSXML library and alter the data in the header. Right click on the Word document which you can’t edit. You'll see it near the top of the Word window, directly to the right of the Home tab. AFAIK to alter a documents header (simply) must be done by having the document open.