Sub OpenFileOrFolderOrWebsite()
Dim strXLSFile As String, strPDFFile As String, strFolder As String, strWebsite As String
Dim strEmail As String, strSubject As String, strEmailHyperlink As String
strFolder = "C:\Test Files\"
strXLSFile = strFolder & "Test1.xls"
strPDFFile = strFolder & "Test.pdf"
strWebsite = "http://www.vbaexpress.com/"
strEmail = "mailto:YourEmailHere@Website.com"
strSubject = "?subject=Test"
strEmailHyperlink = strEmail & strSubject
ActiveWorkbook.FollowHyperlink Address:=strFolder, NewWindow:=True
ActiveWorkbook.FollowHyperlink Address:=strXLSFile, NewWindow:=True
ActiveWorkbook.FollowHyperlink Address:=strPDFFile, NewWindow:=True
ActiveWorkbook.FollowHyperlink Address:=strWebsite, NewWindow:=True
ActiveWorkbook.FollowHyperlink Address:=strEmailHyperlink, NewWindow:=True
End Sub
|