Hello,
I really need your help here... I have been looking for the answer for too long now, without success.
I have a user form where the user "uploads" a document. Then, the path to the document is recorded onto the spreadsheet (and it works properly).
Now, I am trying to send the link to that document via outlook.
However, I keep on receiving an error message:
<Error>
<Code>AccountRequiresHttps</Code>
<Message>The account being accessed does not support http. RequestId:xxxxx Time:2021-11-02T18:49:05.4834541Z</Message>
<AccountName>parentdomain</AccountName>
</Error>
When I hover over the link in the mail, I see the address to the file is not complete, it gets cut half way through.
Additionally, I see the path begins with http, but that is not what I mean. The link I want to send leads to a file in the shared drive.
Here is my code:
Dim sh As Worksheet
Dim Currentrow As Long
Dim hyp As Object
Dim lien As String
Dim email As Outlook.Application
Dim NewEmail As Outlook.MailItem
Set email = New Outlook.Application
Set NewMail = email.CreateItem(olMailItem)
Set sh = ThisWorkbook.Sheets("2021-CSM")
Currentrow = ActiveCell.Row
With sh
Set hyp = sh.Cells(Currentrow, 54)
Dim sName As String
sName = CreateObject("scripting.filesystemobject").getbasename(UserForm2.LabelDocPath.Caption)
hyp.Parent.Hyperlinks.Add Anchor:=hyp, Address:=UserForm2.LabelDocPath.Caption, TextToDisplay:=sName
lien = hyp.Hyperlinks.Item(1).Address
End With
NewMail.SentOnBehalfOfName = "usermane@dominion.ca"
NewMail.To = "username@dominion.ca"
' NewMail.CC = "username@dominion.ca"
NewMail.Subject = "RGA " & sh.Cells(Currentrow, 5) & " a été reçu - " & sh.Cells(Currentrow, 27)
NewMail.HTMLBody = "Bonjour," & "<BR><BR>" & _
"On vient de recevoir le RGA # " & sh.Cells(Currentrow, 5) & _
"<BR>" & _
"Voici le lien vers les documents de reception:" & "<a href=" & lien & ">Click here</a>" & _
"<BR><BR>" & _
"Merci,"
NewMail.Send
Thanks in advance for your help,
I really need your help here... I have been looking for the answer for too long now, without success.
I have a user form where the user "uploads" a document. Then, the path to the document is recorded onto the spreadsheet (and it works properly).
Now, I am trying to send the link to that document via outlook.
However, I keep on receiving an error message:
<Error>
<Code>AccountRequiresHttps</Code>
<Message>The account being accessed does not support http. RequestId:xxxxx Time:2021-11-02T18:49:05.4834541Z</Message>
<AccountName>parentdomain</AccountName>
</Error>
When I hover over the link in the mail, I see the address to the file is not complete, it gets cut half way through.
Additionally, I see the path begins with http, but that is not what I mean. The link I want to send leads to a file in the shared drive.
Here is my code:
Dim sh As Worksheet
Dim Currentrow As Long
Dim hyp As Object
Dim lien As String
Dim email As Outlook.Application
Dim NewEmail As Outlook.MailItem
Set email = New Outlook.Application
Set NewMail = email.CreateItem(olMailItem)
Set sh = ThisWorkbook.Sheets("2021-CSM")
Currentrow = ActiveCell.Row
With sh
Set hyp = sh.Cells(Currentrow, 54)
Dim sName As String
sName = CreateObject("scripting.filesystemobject").getbasename(UserForm2.LabelDocPath.Caption)
hyp.Parent.Hyperlinks.Add Anchor:=hyp, Address:=UserForm2.LabelDocPath.Caption, TextToDisplay:=sName
lien = hyp.Hyperlinks.Item(1).Address
End With
NewMail.SentOnBehalfOfName = "usermane@dominion.ca"
NewMail.To = "username@dominion.ca"
' NewMail.CC = "username@dominion.ca"
NewMail.Subject = "RGA " & sh.Cells(Currentrow, 5) & " a été reçu - " & sh.Cells(Currentrow, 27)
NewMail.HTMLBody = "Bonjour," & "<BR><BR>" & _
"On vient de recevoir le RGA # " & sh.Cells(Currentrow, 5) & _
"<BR>" & _
"Voici le lien vers les documents de reception:" & "<a href=" & lien & ">Click here</a>" & _
"<BR><BR>" & _
"Merci,"
NewMail.Send
Thanks in advance for your help,