View Single Post
  #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