ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening a Word and/or PDF document from Excel (https://www.excelbanter.com/excel-programming/346820-opening-word-pdf-document-excel.html)

Vikesh Jain

Opening a Word and/or PDF document from Excel
 
I want to write a macro which on execution opens a file (Word document
/ PDF - in their respective applications) which is stored at a
specified path on my system. Can somebody provide me a vba code for
doing the same?


Paul B

Opening a Word and/or PDF document from Excel
 
Vikesh, here is one way,

Sub OpenFiles()
Dim sPath As String
sPath = "C:\My Documents\"
With ThisWorkbook
.FollowHyperlink sPath & "test.pdf"
.FollowHyperlink sPath & "test.doc"
End With
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Vikesh Jain" wrote in message
ups.com...
I want to write a macro which on execution opens a file (Word document
/ PDF - in their respective applications) which is stored at a
specified path on my system. Can somebody provide me a vba code for
doing the same?





All times are GMT +1. The time now is 03:37 AM.

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