I have this VBA
But only this gets hyperlinked "file:///I:\PERISHABLES\Merchandising\East\Meat"
Can someone help?
VBA Code:
Sub MyEmail_Review()
Dim MyDateF As Date
'Application.DisplayAlerts = False
x = 2
MyDate = Date
MyDate1 = Cells(2, "A").Value
Do Until MyDate = MyDate1
x = x + 1
MyDate1 = Cells(x, "A").Value
Loop
MyDateF = Cells(x, "C").Value
MyPathF = "I:\PERISHABLES\Merchandising\East\Meat - Packaged, Fresh and Frozen\Ad\Indept Ads " & Format(MyDateF, "yyyy") & "\" & Format(MyDateF, "mm-dd-yy") & "\Fresh and Seafood\"
MyFileF = Dir(MyPathF & "*Store Copy.xlsx", vbDirectory)
MyPathP = "I:\PERISHABLES\Merchandising\East\Meat - Packaged, Fresh and Frozen\Ad\Indept Ads " & Format(MyDateP, "yyyy") & "\" & Format(MyDateP, "mm-dd-yy") & "\Pckg & Frzn\"
MyFileP = Dir(MyPathP & "*Store Copy.xlsx", vbDirectory)
MyFile1 = MyPathF & MyFileF
Myfile2 = MyPathP & MyFileP
'NE IND
Dim vst As Worksheet
Dim MyBody As Variant
Dim MySubjec As Variant
Dim MyEmail As Variant
Dim MyCC As Variant
Dim oLink As Object
Set vst = Sheets("Control")
MySubject = "Review Merchandisers"
MyBody = "Please review Merchandisers before I email." & _
"Click on the link to open the file :<br><br> file:///" & _
MyFile1
MyEmail = "cde@xyz.com"
'sets up email parameters
Dim Email_Subject, Email_Send_From, Email_Send_To, _
Email_Cc, Email_Bcc, Email_Body As String
Dim Mail_Object, Mail_Single As Variant
Email_Subject = MySubject
Email_Send_From = "abc@xyz.com"
Email_Send_To = MyEmail
Email_Body = MyBody
On Error GoTo debugs
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.SentOnBehalfOfName = Email_Send_From
.To = Email_Send_To
.cc = Email_Cc
.HTMLbody = Email_Body
.Display
' .Send
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
'
'
'
MsgBox ("All Set thank you!")
End Sub
But only this gets hyperlinked "file:///I:\PERISHABLES\Merchandising\East\Meat"
Can someone help?
Last edited by a moderator: