SOLVED

LINK in combination with REF

Copper Contributor

Hello everybody,

 

I am retrieving some data from Excel-Sheets. For this I am using the LINK field in Word:

{LINK Excel.Sheet.12 \\Path\\File.xlsx CellName /t /f 2}

So far, this works perfectly.

 

Now, I would like to go one step further as the filename might change:

{SET Path_File \\Path\\File.xlsx}

{LINK Excel.Sheet.12 {REF Path_File} CellName /t /f 2}

After actualization of all fields the last line changes to 

{LINK Excel.Sheet.12 \\Path\\File.xlsx CellName /t /f 2}

and the REF-field disappears.

 

Does anybody have an idea how to avoid this? As I have many links in my document, I want to centrally change the filename once, in the SET line.

 

Thanks a lot!

2 Replies
best response confirmed by MatthiasGehrke (Copper Contributor)
Solution
This has been a known limitation of Word since... well, forever. Macropod (Paul Edstein) created a macro solution long ago. It was originally posted in the Windows Secrets lounge, which has now been absorbed into AskWoody.com. You can find the discussion and download the zip file from https://www.askwoody.com/forums/topic/word-fields-and-relative-paths-to-external-files/.

@Jay Freedman 

Thanks for the quick answer an the link to the macro!

1 best response

Accepted Solutions
best response confirmed by MatthiasGehrke (Copper Contributor)
Solution
This has been a known limitation of Word since... well, forever. Macropod (Paul Edstein) created a macro solution long ago. It was originally posted in the Windows Secrets lounge, which has now been absorbed into AskWoody.com. You can find the discussion and download the zip file from https://www.askwoody.com/forums/topic/word-fields-and-relative-paths-to-external-files/.

View solution in original post