alexaronson
Active Member
- Joined
- Sep 30, 2005
- Messages
- 314
Hello and thank you for looking at my question.
I have a macro that creates several files and saves them. A task that I have to do every day is email out a hyperlink to the parties that need to review these files when the files are updated. I want to automate my message when the file is done.
So far I am able to create a new outlook message, enter a To, Subject, and Body text and send the email. However, I can't get the message to display the hyperlink.
when I try changing
To
I get "Complie error: Expecdted: end of statement" at the word of Anchor.
When I Try changing the code to
The first .Body goes away and is replaced with the second .Body. Also the second .Body is not a hyperlink.
Any suggestions?
I have a macro that creates several files and saves them. A task that I have to do every day is email out a hyperlink to the parties that need to review these files when the files are updated. I want to automate my message when the file is done.
So far I am able to create a new outlook message, enter a To, Subject, and Body text and send the email. However, I can't get the message to display the hyperlink.
Code:
Sub Test()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "Test"
.CC = ""
.BCC = ""
.Subject = "Alert 10 for " & Date & " updated"
.Body = "Alert 10 for " & Date & " updated"
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"S:\COLLABORATIVE SHARING FOLDER\TeamA\Sales\Reports\Alert 10", _
TextToDisplay:="Alert 10"
.Display
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
when I try changing
Code:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"S:\COLLABORATIVE SHARING FOLDER\TeamA\Sales\Reports\Alert 10", _
TextToDisplay:="Alert 10"
Code:
.Body = ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"S:\COLLABORATIVE SHARING FOLDER\TeamA\Sales\Reports\Alert 10", _
TextToDisplay:="Alert 10"
When I Try changing the code to
Code:
.Body = "Alert 10 for " & Date & " updated"
.Body = "S:\COLLABORATIVE SHARING FOLDER\TeamA\Sales\Reports\Alert 10"
Any suggestions?