![]() |
|
|
|
#1
|
||||
|
||||
|
Unfortunately, Word doesn't provide a global setting, or even a 'Links' collection that one could use to programmatically change all the links. All that leaves you with is a macro to go through every field, shape and inlineshape in the document, looking for links to re-set. A macro you might use for that is:
Code:
Sub ToggleLinkUpdates()
Application.ScreenUpdating = False
Dim Rng As Range, Fld As Field, Shp As Shape, iShp As InlineShape, Rslt As Variant, bUpd As Boolean
Rslt = MsgBox("Set Link Updates to Auto (Y) or Manual (N)?", vbYesNoCancel, "Toggle Link Updates")
If Rslt = vbCancel Then Exit Sub: If Rslt = vbYes Then bUpd = True: If Rslt = vbNo Then bUpd = False
With ActiveDocument
For Each Rng In .StoryRanges
For Each Fld In Rng.Fields
If Fld.Type = wdFieldLink Then Fld.LinkFormat.AutoUpdate = bUpd
Next
For Each Shp In Rng.ShapeRange
If Not Shp.LinkFormat Is Nothing Then Shp.LinkFormat.AutoUpdate = bUpd
Next
For Each iShp In Rng.InlineShapes
If Not iShp.LinkFormat Is Nothing Then iShp.LinkFormat.AutoUpdate = bUpd
Next
Next
End With
Application.ScreenUpdating = True
End Sub
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\W ord\Options
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
The macro looks very cool, but unfortunantly i wasn't able to get it to work. It kept crashing my document.
I will try and test it later on another document with less links. I was however able to solve most of the errors. The broken links can be fixed by this tool: http://www.oaltd.co.uk/MVP/Default.htm (FindLink) that helped me locate and delete the broken links. The one error i still can't quite figure out is the "... Reopening will cause any changes you made to be discarded ... " I don't have any documents open when i open the Main Word documents with all the links attached. I do have multiple links to the same excel workbook so a possibility could be that it opens the excel workbook when it first comes across the link, when opening the main word document, and the next time, it gets confused. This does not seem realistic though, as the error comes about 5-10 times only when i open my word document, but i have 100-200 links to the same excel workbook. Also just to be clear - I have changed all the links to manual now. But any new created links are set to Auto by default. Why is this? And can it be changed! |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Word Template Always Opening | Hobbes | Word | 7 | 09-24-2014 11:00 PM |
Need Help With Opening a Word Document
|
PosseJohn | Word VBA | 1 | 12-06-2013 01:16 PM |
Word files not opening
|
dogMarine | Word | 1 | 10-15-2012 11:32 AM |
| Opening Word XML files in IE8? | RBizzle | Word | 0 | 09-13-2010 08:25 AM |
Opening word docs
|
Bemklaver | Word | 1 | 03-31-2010 02:22 AM |