ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   open word file? (https://www.excelbanter.com/excel-programming/286576-open-word-file.html)

pgoodale[_3_]

open word file?
 
How do I open a word file from excel. I have a vast amount of
information which I want to link to word documents which are all kept
in the same folder. However, there are too many of these links so I
can't just create hyperlinks. Instead I need a code to select the file
once the certain cell is selected. The word files are all the same with
the exception of a number, i.e. WORD001, WORD002, WORD003, etc. I have
come up with this which selects the cell as a target. What is the code
which will open the word document.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Left(Target, 3) = "BOM" Then

Open ("S:\Technical Support\ then the wordname. in this
example, it will be target.

MsgBox Target

End If

Will this code work? What is the open command? Any help is appreciated.
Thanks.


---
Message posted from http://www.ExcelForum.com/


Tom Ogilvy

open word file?
 
Some places to start:


http://support.microsoft.com/?id=149830
XL: Macro to Link a Range of Cells in Word
(Example of Excel controlling word)


http://support.microsoft.com/?id=165926
OFF97: Can't Dimension Word as Application from Other Program
(Examples of Working with Word 97 using OLE)

http://support.microsoft.com/?id=135082
Invalid Page Fault Running VB Macro in Hidden Word Session
(Word 7, when Word is Closed causes a problem)

http://support.microsoft.com/?id=167223
Microsoft Office 97 Automation Help File Available on MSL


--
Regards,
Tom Ogilvy

"pgoodale" wrote in message
...
How do I open a word file from excel. I have a vast amount of
information which I want to link to word documents which are all kept
in the same folder. However, there are too many of these links so I
can't just create hyperlinks. Instead I need a code to select the file
once the certain cell is selected. The word files are all the same with
the exception of a number, i.e. WORD001, WORD002, WORD003, etc. I have
come up with this which selects the cell as a target. What is the code
which will open the word document.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Left(Target, 3) = "BOM" Then

Open ("S:\Technical Support\ then the wordname. in this
example, it will be target.

MsgBox Target

End If

Will this code work? What is the open command? Any help is appreciated.
Thanks.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com