G'day "Marek" <
[email protected]>,
How to
----------
To trick the Master into inserting relative, whenever you insert a
subby, do this (subbys must be in same dir as master):
Select Insert Subby
Browse to the folder the Master is in
Close the dialog
Insert Subby
The dialog will now open the Master doc folder.
Double-click the file to insert or select then select Insert.
Specific fix
---------------
To fix the problem, use this macro:
Public Sub ForceRelativeSubdocuments()
'Another document solution from wordheretic.com
'Forces all sub-documents to use the same path as the Master by
'changing the hyperlink that the subdocuments depend on to reference
'their source. You cannot change subdoc filenames directly because
'of this.
'You might need to add section break handlers every iteration
Dim Subby As Subdocument
Dim HyperAddy As String
Dim EndPath As Long
With Application
.DisplayAlerts = wdAlertsNone 'Stop the popup box
.ScreenUpdating = False 'Speed it up
.StatusBar = "Making subdocuments relative"
End With
System.Cursor = wdCursorWait
'Main
ActiveDocument.Subdocuments.Expanded = False
For Each Subby In ActiveDocument.Subdocuments
With Subby.Range.Hyperlinks(1)
HyperAddy = .Address
EndPath = InStrRev(HyperAddy, "\")
.Address = Mid$(HyperAddy, EndPath + 1)
End With
Next
'Open the subs up
ActiveDocument.Subdocuments.Expanded = True
'Exit
With Application
.DisplayAlerts = wdAlertsAll
.ScreenUpdating = True
.StatusBar = "Subdocuments are now relative, save your work"
End With
System.Cursor = wdCursorNormal
Set Subby = Nothing
End Sub
Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com
steve from wordheretic.com (Email replies require payment)
Marek reckoned: