Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
WJFinNZ WJFinNZ is offline
external usenet poster
 
Posts: 1
Default Link Excel Word Current Directory

I have a Word 2007 Doc with multiple links (not embedded) to one Excel
Worksheet. The two have many copies for different uses and users but always
appear in a folder together. Is there a quick way to set Links in the Word
document to the equivalent of $CurrentDirectory so that I do not have to
update a long list of Links every time I copy it to a new location. Managing
Trust Centre is not a problem.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Link Excel Word Current Directory

See Item 7 in the article at
http://support.microsoft.com/default...en-us%3B159940

The following macro can also be used to update the links:

' Macro created 26/10/01 by Doug Robbins to update links in a document
'
Dim alink As Field, linktype As Range, linkfile As Range
Dim linklocation As Range, i As Integer, j As Integer, linkcode As Range
Dim Message, Title, Default, Newfile
Dim counter As Long


counter = 0
For Each alink In ActiveDocument.Fields
If alink.Type = wdFieldLink Then

Set linkcode = alink.Code
i = InStr(linkcode, Chr(34))
Set linktype = alink.Code
linktype.End = linktype.Start + i
j = InStr(Mid(linkcode, i + 1), Chr(34))
Set linklocation = alink.Code
linklocation.Start = linklocation.Start + i + j - 1
If counter = 0 Then
Set linkfile = alink.Code
linkfile.End = linkfile.Start + i + j - 1
linkfile.Start = linkfile.Start + i
Message = "Enter the modified path and filename following this
Format " & linkfile
Title = "Update Link"
Default = linkfile
Newfile = InputBox(Message, Title, Default)
End If
linkcode.Text = linktype & Newfile & linklocation
counter = counter + 1
End If
Next alink


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"WJFinNZ" wrote in message
...
I have a Word 2007 Doc with multiple links (not embedded) to one Excel
Worksheet. The two have many copies for different uses and users but
always
appear in a folder together. Is there a quick way to set Links in the Word
document to the equivalent of $CurrentDirectory so that I do not have to
update a long list of Links every time I copy it to a new location.
Managing
Trust Centre is not a problem.



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
Grouping an Excel Field in a Word 2003 Directory Merge Lynn Q Mailmerge 1 February 12th 07 07:33 AM
Word Directory Style Merge from Excel Annie Mailmerge 2 April 28th 06 05:51 PM
How do I create change current directory macro techman Microsoft Word Help 1 December 12th 05 05:35 PM
How do you convert an excel document into a word directory docume. JimBob3rd Microsoft Word Help 2 April 20th 05 12:54 AM
Excel Link: Adding rows in Excel does not add cells in Word Jameslp Tables 2 December 9th 04 07:18 PM


All times are GMT +1. The time now is 03:35 PM.

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"