![]() |
Attaching cells to word documents
I have a large excel spreadsheet. Within the spreadsheet are references
to word documents. These word documents are all stored in the same folder. The only difference between what the word documents are called, is a number, i.e. WORD123, WORD537, etc. I wish to make a link within the excel spreadsheet to these word documents. I know I could use hyperlinks to do this, however there are a vast quantity of links that I wish to make and it would take too long to do it this way. If I use a macro could I write a code to automatically find these word documents. Any help is really appreciated. Thanks. --- Message posted from http://www.ExcelForum.com/ |
Attaching cells to word documents
You can use the filesearch object to search the directory for "Word.doc"
and I believe it will retrieve a list of these files with their path. See help on the filesearch object. -- Regards, Tom Ogilvy "pgoodale" wrote in message ... I have a large excel spreadsheet. Within the spreadsheet are references to word documents. These word documents are all stored in the same folder. The only difference between what the word documents are called, is a number, i.e. WORD123, WORD537, etc. I wish to make a link within the excel spreadsheet to these word documents. I know I could use hyperlinks to do this, however there are a vast quantity of links that I wish to make and it would take too long to do it this way. If I use a macro could I write a code to automatically find these word documents. Any help is really appreciated. Thanks. --- Message posted from http://www.ExcelForum.com/ |
Attaching cells to word documents
pgoodale,
You could try something like this: Dim appWD As Word.Application 'Set-up appWD Set appWD = CreateObject("Word.Application.9") 'Open M.S. Word 2000 appWD.ChangeFileOpenDirectory "C:\MywordDocs" 'Word looks here for file appWD.Documents.Open Filename="WORD" & Range("A1").Value Where A1 contains the number of the Word Doc you want to open and all your docs are in the folder C:\MywordDocs HTH Henry "pgoodale" wrote in message ... I have a large excel spreadsheet. Within the spreadsheet are references to word documents. These word documents are all stored in the same folder. The only difference between what the word documents are called, is a number, i.e. WORD123, WORD537, etc. I wish to make a link within the excel spreadsheet to these word documents. I know I could use hyperlinks to do this, however there are a vast quantity of links that I wish to make and it would take too long to do it this way. If I use a macro could I write a code to automatically find these word documents. Any help is really appreciated. Thanks. --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 08:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com