Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
pdberger pdberger is offline
external usenet poster
 
Posts: 6
Default Moving Excel-Word Links

Good afternoon.
I have a Word document that consists of almost nothing but about 300 links
from an Excel worksheet. I use the Excel file to store information, and
translate short answers into longer textual comments (sometimes a couple of
sentences). I use the Word document to organize and format those longer
comments into a document that's ready for a final review and release.

Currently, these two files sit in the same directory on my office PC. I'd
like to move them to a central server, or another user's PC, and have the new
copy of the Word document look to the NEW copy of the Excel source document,
not the one on my office PC.

How can I do that? Does it have to do with having them both open and active
as I save them where they need to be?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Moving Excel-Word Links

The following macro can be used to update the links in the document to the
new location of the spreadsheet:

' 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 Integer


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

"pdberger" wrote in message
news
Good afternoon.
I have a Word document that consists of almost nothing but about 300 links
from an Excel worksheet. I use the Excel file to store information, and
translate short answers into longer textual comments (sometimes a couple
of
sentences). I use the Word document to organize and format those longer
comments into a document that's ready for a final review and release.

Currently, these two files sit in the same directory on my office PC. I'd
like to move them to a central server, or another user's PC, and have the
new
copy of the Word document look to the NEW copy of the Excel source
document,
not the one on my office PC.

How can I do that? Does it have to do with having them both open and
active
as I save them where they need to be?

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
pdberger pdberger is offline
external usenet poster
 
Posts: 6
Default Moving Excel-Word Links

Senor Robbins --

Many thanks. I appreciate the help.

Peter

"Doug Robbins - Word MVP" wrote:

The following macro can be used to update the links in the document to the
new location of the spreadsheet:

' 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 Integer


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

"pdberger" wrote in message
news
Good afternoon.
I have a Word document that consists of almost nothing but about 300 links
from an Excel worksheet. I use the Excel file to store information, and
translate short answers into longer textual comments (sometimes a couple
of
sentences). I use the Word document to organize and format those longer
comments into a document that's ready for a final review and release.

Currently, these two files sit in the same directory on my office PC. I'd
like to move them to a central server, or another user's PC, and have the
new
copy of the Word document look to the NEW copy of the Excel source
document,
not the one on my office PC.

How can I do that? Does it have to do with having them both open and
active
as I save them where they need to be?

Thanks in advance.




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
Links and moving documents and directories Luke Williams Microsoft Word Help 1 June 4th 07 06:46 PM
Moving Text from Excel to Word PGP Microsoft Word Help 1 April 21st 06 04:38 PM
fast way to change links when moving two linked files. goshawk Microsoft Word Help 1 February 9th 06 12:25 PM
Word to Excel links CAE1030 Microsoft Word Help 3 January 20th 06 05:37 PM
Moving form data from Word to an Excel Spreadsheet? J.Polayes Microsoft Word Help 3 December 29th 05 02:28 PM


All times are GMT +1. The time now is 08:03 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"