JimDavis
12-02-2006, 04:36 AM
With a word file containing dozens of links to excel files, transferring from one computer to anouther they are all broken because the folder set up is different.
This piece of code works, but not on all files and it takes about 20 seconds a file.
ActiveDocument.Fields(i).LinkFormat.SourceFullName = ActiveDocument.Path & "\" & ActiveDocument.Fields(i).LinkFormat.SourceName
and this is just as slow.
mySourcename = ActiveDocument.Path & "\" & ActiveDocument.Shapes(i).LinkFormat.SourceName
ActiveDocument.Shapes(i).LinkFormat.SourceFullName = mySourcename
also setting autoupdate on false only works if you first repair the link:
in the sense that this gives you a run time error
ActiveDocument.Fields(i).LinkFormat.AutoUpdate = False
ActiveDocument.Fields(i).LinkFormat.SourceFullName = ActiveDocument.Path & "\" & ActiveDocument.Fields(i).LinkFormat.SourceName
If the above worked it would hopefully mean it is not necessary to turn global automatic update options off in word and in excel.
Anybody got any ideas.
Thanks in advance
This piece of code works, but not on all files and it takes about 20 seconds a file.
ActiveDocument.Fields(i).LinkFormat.SourceFullName = ActiveDocument.Path & "\" & ActiveDocument.Fields(i).LinkFormat.SourceName
and this is just as slow.
mySourcename = ActiveDocument.Path & "\" & ActiveDocument.Shapes(i).LinkFormat.SourceName
ActiveDocument.Shapes(i).LinkFormat.SourceFullName = mySourcename
also setting autoupdate on false only works if you first repair the link:
in the sense that this gives you a run time error
ActiveDocument.Fields(i).LinkFormat.AutoUpdate = False
ActiveDocument.Fields(i).LinkFormat.SourceFullName = ActiveDocument.Path & "\" & ActiveDocument.Fields(i).LinkFormat.SourceName
If the above worked it would hopefully mean it is not necessary to turn global automatic update options off in word and in excel.
Anybody got any ideas.
Thanks in advance