Reply
 
Thread Tools Display Modes
  #1   Report Post  
domdagbui domdagbui is offline
Junior Member
 
Posts: 6
Question Locking all footer field codes

Hi All,

Wondering if anyone could advice me on how to lock/unlink all field codes in the footers of my 1600page document.

A different footer appears on the first page of each section of the document (about 140 in all). I can go to each one manually and hit CTRL+F11 to lock but there are just too many of them and getting to each one takes a lot of scrolling.

Any advice please?
Desperate for answers just now
D
  #2   Report Post  
Venky62 Venky62 is offline
Junior Member
 
Posts: 19
Default

Please use this code. But save your original document and test this code on a copy to see if it works. I have not tested this code, but reading it, it seems it will do the job. And this has been given by Macropod, who always gives great macros.

Please note that this will unlink all fields in the document, which means fields in the main document along with fields in footers, which means even page number fields. After running the code, if you add pages in between, the new pages will not show page numbers at all, and if you add a new page number field, it will be out of sync with rest of document. If you want to only unlink fields in the footer, then the code below has to be modified.

To run this code, go to the code window (Alt+F11), paste this code in the blank window on the right. Place your cursor anywhere in the code and press F5. But be sure you are doing this on a copy of your original. First test it on a copy!

Sub UnlinkAll()
Dim oRng As Range, hLink As Hyperlink
Application.ScreenUpdating = False
With ActiveDocument
' Loop through Story Ranges and update.
' Note that this may trigger interactive fields (eg ASK and FILLIN).
For Each oRng In .StoryRanges
Do
oRng.Fields.Unlink
For Each hLink In oRng.Hyperlinks
hLink.Delete
Next
Set oRng = oRng.NextStoryRange
Loop Until oRng Is Nothing
Next
End With
Application.ScreenUpdating = True
End Sub

This code was given by macropod at this site. You can go there to find out more

https://groups.google.com/forum/?fro...nt/Y3z5psNb2YM

Quote:
Originally Posted by domdagbui View Post
Hi All,

Wondering if anyone could advice me on how to lock/unlink all field codes in the footers of my 1600page document.

A different footer appears on the first page of each section of the document (about 140 in all). I can go to each one manually and hit CTRL+F11 to lock but there are just too many of them and getting to each one takes a lot of scrolling.

Any advice please?
Desperate for answers just now
D
  #3   Report Post  
domdagbui domdagbui is offline
Junior Member
 
Posts: 6
Post

Hello Venky,

Thanks for the reply. ALT+F11 opens the codes field alright but I can't seem to be able to paste anything in the blank grey fields on the right as you suggested. Both CTRL+V and right clicking to paste do not seem to work for some reason.

Any pointers?

D

Quote:
Originally Posted by Venky62 View Post
Please use this code. But save your original document and test this code on a copy to see if it works. I have not tested this code, but reading it, it seems it will do the job. And this has been given by Macropod, who always gives great macros.

Please note that this will unlink all fields in the document, which means fields in the main document along with fields in footers, which means even page number fields. After running the code, if you add pages in between, the new pages will not show page numbers at all, and if you add a new page number field, it will be out of sync with rest of document. If you want to only unlink fields in the footer, then the code below has to be modified.

To run this code, go to the code window (Alt+F11), paste this code in the blank window on the right. Place your cursor anywhere in the code and press F5. But be sure you are doing this on a copy of your original. First test it on a copy!

Sub UnlinkAll()
Dim oRng As Range, hLink As Hyperlink
Application.ScreenUpdating = False
With ActiveDocument
' Loop through Story Ranges and update.
' Note that this may trigger interactive fields (eg ASK and FILLIN).
For Each oRng In .StoryRanges
Do
oRng.Fields.Unlink
For Each hLink In oRng.Hyperlinks
hLink.Delete
Next
Set oRng = oRng.NextStoryRange
Loop Until oRng Is Nothing
Next
End With
Application.ScreenUpdating = True
End Sub

This code was given by macropod at this site. You can go there to find out more

https://groups.google.com/forum/?fro...nt/Y3z5psNb2YM
  #4   Report Post  
domdagbui domdagbui is offline
Junior Member
 
Posts: 6
Thumbs up

Hey Venky!

Its worked now! Figured out I had to click the document (project) on the left to activate the code field.

Tried the code and its worked 'well good!'

Thanks mate.

D

Quote:
Originally Posted by domdagbui View Post
Hello Venky,

Thanks for the reply. ALT+F11 opens the codes field alright but I can't seem to be able to paste anything in the blank grey fields on the right as you suggested. Both CTRL+V and right clicking to paste do not seem to work for some reason.

Any pointers?

D
  #5   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Locking all footer field codes

I suspect a macro must be used for this. But, since the page numbers are also
fields, you probably don't want to lock or unlink *all* field codes in the
footers. (A locked or unlinked page field will show the same page number for all
pages.)

If you explained more in detail why you want to prevent the fields from
updating, that would make it easier to suggest an approach...

--
Stefan Blom
Microsoft Word MVP




"domdagbui" wrote in message ...

Hi All,

Wondering if anyone could advice me on how to lock/unlink all field
codes in the footers of my 1600page document.

A different footer appears on the first page of each section of the
document (about 140 in all). I can go to each one manually and hit
CTRL+F11 to lock but there are just too many of them and getting to each
one takes a lot of scrolling.

Any advice please?
Desperate for answers just now
D




--
domdagbui



  #6   Report Post  
Venky62 Venky62 is offline
Junior Member
 
Posts: 19
Default

You have to select a project from the left hand window. In the left hand window you will find a Folder tree with Normal at top, followed by Project(Your document Name) below that, and so on. Since you may want this code only in this document and not all documents, click on the + sign next to the Project with your document name. You will find two folders under it. Click on the + sign next to the Microsoft Word Objects folder. It will reveal "This document" below it. Double-Click on "This Document". The right hand pane will get activated. Then paste the code in the right hand pane, and follow the rest of the instructions given in my previous post.

If you are using Word 2007 or later version, you will be prompted to save it as a Word macro-enabled document with the extension .docm. Accept that. Otherwise you will not be able to save your document.

Quote:
Originally Posted by domdagbui View Post
Hello Venky,

Thanks for the reply. ALT+F11 opens the codes field alright but I can't seem to be able to paste anything in the blank grey fields on the right as you suggested. Both CTRL+V and right clicking to paste do not seem to work for some reason.

Any pointers?

D
  #7   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default Locking all footer field codes

I'm glad you got it sorted. Out of curiosity, where is the actual code posted? I
don't seem to find it anywhere in this thread.

--
Stefan Blom
Microsoft Word MVP




"domdagbui" wrote in message ...

Hey Venky!

Its worked now! Figured out I had to click the document (project) on the
left to activate the code field.

Tried the code and its worked 'well good!'

Thanks mate.

D

domdagbui;492990 Wrote:
Hello Venky,

Thanks for the reply. ALT+F11 opens the codes field alright but I can't
seem to be able to paste anything in the blank grey fields on the right
as you suggested. Both CTRL+V and right clicking to paste do not seem to
work for some reason.

Any pointers?

D





--
domdagbui

  #8   Report Post  
Venky62 Venky62 is offline
Junior Member
 
Posts: 19
Default

It is posted in wordbanter.com. Thread:
http://www.wordbanter.com/showthread.php?t=155399

Quote:
Originally Posted by Stefan Blom[_3_] View Post
I'm glad you got it sorted. Out of curiosity, where is the actual code posted? I
don't seem to find it anywhere in this thread.

--
Stefan Blom
Microsoft Word MVP




"domdagbui" wrote in message ...

Hey Venky!

Its worked now! Figured out I had to click the document (project) on the
left to activate the code field.

Tried the code and its worked 'well good!'

Thanks mate.

D

domdagbui;492990 Wrote:
Hello Venky,

Thanks for the reply. ALT+F11 opens the codes field alright but I can't
seem to be able to paste anything in the blank grey fields on the right
as you suggested. Both CTRL+V and right clicking to paste do not seem to
work for some reason.

Any pointers?

D





--
domdagbui
  #9   Report Post  
domdagbui domdagbui is offline
Junior Member
 
Posts: 6
Cool

Hey all,

Just realised a problem with the macro. It messes up the page numbers.
My first 12 pages changed from Roman Numerals to normal numbers and the pages that follow now use some sort of random numbering I cant fathom.

Positive from this: my footers and headers have been locked though for copying! Which is what I wanted though.

Warning: TRY THE MACRO ONLY ON A COPY OF YOUR DOCUMENT. NOT THE ORIGINAL. CHANGES SEEM IRREVERSIBLE.

Quote:
Originally Posted by Venky62 View Post
It is posted in wordbanter.com. Thread:
http://www.wordbanter.com/showthread.php?t=155399
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ignore merge field codes when field doesn't exist mcalex Mailmerge 2 October 29th 08 08:56 AM
Locking images in Header/Footer Sarah Microsoft Word Help 1 October 6th 08 03:15 PM
Locking Pictures / Header / Footer Luke Page Layout 3 February 29th 08 10:09 PM
Field codes: MergeField field RTF format problem Amdious Mailmerge 4 September 17th 07 02:38 PM
Saving word document with field results not field codes Cambdoc Microsoft Word Help 2 July 14th 06 10:51 AM


All times are GMT +1. The time now is 12:09 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"