ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing Word Document from Hyperlink -- Can't get the full path!!! Please Help (https://www.excelbanter.com/excel-programming/327588-printing-word-document-hyperlink-cant-get-full-path-please-help.html)

JadPlane

Printing Word Document from Hyperlink -- Can't get the full path!!! Please Help
 
I am trying to print a Word document using the address found in
a Hyperlink but I can't get the hyperling full path!!!

I want to get rid of the hardcoded "D:\Excel\Matrice\"

Can someone help me?

Thanks!

Here's the working code...


Dim oAppWord As Object
Dim sFiche As String
Dim sChemin As String

' -- I want to get rid of this line...
sChemin = "D:\Excel\Matrice\"
' ------------------------------------

sFiche = Range("B5").Hyperlinks(1).Address

Set oAppWord = CreateObject("Word.Application")
oAppWord.Documents.Open Filename:=sChemin & sFiche
With oAppWord.ActiveDocument
.PrintOut
.Close
End With



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

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